Pete's dad
Petya's dad works at the "Macrohard" company. Petya knows that this prestigious company employs n people, but only his dad writes programs. All other employees delegate tasks to their subordinates. Each employee can have multiple direct superiors, but each, except for Petya's dad, has only one direct subordinate to whom they can delegate tasks.
Recently, the company decided to reorganize so that Petya's dad reports directly to all other employees. To achieve this, the following steps are taken: an employee is chosen, and they, along with everyone they can command either directly or through their subordinates, are appointed as superiors over Petya's dad.
The goal is to reorganize the company in the minimum number of steps. Surprisingly, solving this problem was assigned to Petya's dad. Help him find the solution.
Input
The first line of the input contains the number n - the total number of employees in the company (1 ≤ n ≤ 100000). The second line contains n-1 numbers ranging from 1 to n - the i-th number indicates the direct subordinate of the employee numbered i+1. Petya's dad is assigned the number 1 in the company.
Output
The output should be a single number - the minimum number of steps required to reorganize the company.