Lately, things have not been going well in Byteland (Bajtocja). Bitogrom, a king consumed by an obsessive fear for his own life, came to power. Only a few days after taking the throne he revealed his ruthless nature, beheading five courtiers suspected of plotting against him. Every official in the country came to fear for their life. They knew that a single denunciation from a superior leads to a swift execution. What made things worse was that whoever informed on someone became a trusted man of the king and was therefore no longer at risk of a death sentence. In the terrified community of state officials, this was motivation enough to denounce one of their own subordinates.
This situation among the officials greatly worried Professor Bajtoszewski, who foresaw the resulting disruptions to the running of the state's sectors. He asked you to compute the maximum number of officials that can be executed as a result of denunciations. The professor explained the rules of how the state works in more detail:
The first line contains a single integer n (1≤n≤1000000), the number of officials. The second line contains n−1 integers, of which the i-th is the number of the superior of the official with number i+1.
In the first and only line, print a single integer equal to the maximum number of officials that can be executed as a result of denunciations.
Explanation of the sample: In the sample above, official 1 denounces official 3 and official 2 denounces official 4, so two officials are executed.
Note that an official who denounces someone becomes a trusted man of the king and can no longer be executed, so an official can either denounce a subordinate (and stay safe) or be executed, but not both.