A tree with n nodes numbered from 1 to n is represented by
the parent array t, where t[i] is the parent of node i, and
t[i] = 0 means that node i is the root of the tree.
The depth of a node is the number of edges on the path from that
node to the root. The root has depth 0, its children have depth 1,
and so on. The height of the tree is the maximum depth found in
the tree.
Write a program that reads n and the values of the parent array, and
prints the height of the tree.