The first line of the input contains an integer n(n<=10000) which means the number of non-root nodes.We give numbers to the nodes from 0 to n.0 means the root and 1~n means the non-root nodes.Then n lines follow, line i consists of an integer Ai,which means node Ai is the parent node of node i.We ensure that it's a tree.
You should output one lines with the max depth value.
5 3 3 0 2 0
2