Sergey and Azat enjoy playing board games. After many hours spent in fierce battles against each other, the guys got tired and decided to try playing cooperative games—in these games, players must cooperate with each other to achieve the best possible result. Luckily for the boys, Azat had just recently been gifted one such game.
In this game, there is a rooted tree with $$$n$$$ vertices with the root at vertex $$$1$$$, as well as a set of chips — one blue and many red. Initially, one blue and one red chip are placed in vertex $$$1$$$. Next, the following steps are taken:
The goal of the game is to end up with as many red chips on the tree as possible. However, the game developers did not specify what the best possible result in the game could be, so the guys are asking you to calculate this information.
The first line contains the number $$$n$$$ ($$$2 \le n \le 2\cdot 10^5$$$) — the number of vertices in the tree. The next line specifies $$$n-1$$$ numbers $$$p_2, p_3, \ldots p_n$$$, where the number $$$p_i$$$ means that vertex $$$i$$$ is a child of vertex $$$p_i$$$ ($$$1 \le p_i \lt i$$$).
Print a single number — the maximum number of red chips that can end up on the tree at the end of the game.
41 1 3
2
31 2
1
In the first example, the optimal sequence of actions is as follows: the first player moves his chip to vertex $$$3$$$, and the second player moves his one to vertex $$$2$$$. After that, a new red chip appears in vertex $$$3$$$, the first player moves the blue chip to vertex $$$4$$$ and the game ends there.
| Name |
|---|


