{"raw_statement":[{"iden":"problem statement","content":"There are $N$ people, called Person $1$, Person $2$, $\\ldots$, Person $N$.\nThe parent of Person $i$ $(2 \\le i \\le N)$ is Person $P_i$. Here, it is guaranteed that $P_i < i$.\nHow many generations away from Person $N$ is Person $1$?"},{"iden":"constraints","content":"*   $2 \\le N \\le 50$\n*   $1 \\le P_i < i(2 \\le i \\le N)$\n*   All values in input are integers."},{"iden":"input","content":"Input is given from Standard Input in the following format:\n\n$N$\n$P_2$ $P_3$ $\\dots$ $P_N$"},{"iden":"sample input 1","content":"3\n1 2"},{"iden":"sample output 1","content":"2\n\nPerson $2$ is a parent of Person $3$, and thus is one generation away from Person $3$.\nPerson $1$ is a parent of Person $2$, and thus is two generations away from Person $3$.\nTherefore, the answer is $2$."},{"iden":"sample input 2","content":"10\n1 2 3 4 5 6 7 8 9"},{"iden":"sample output 2","content":"9"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}