atcoder#ABC263B. [ABC263B] Ancestor
[ABC263B] Ancestor
Score : points
Problem Statement
There are people, called Person , Person , , Person .
The parent of Person is Person . Here, it is guaranteed that .
How many generations away from Person is Person ?
Constraints
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
Output
Print the answer as a positive integer.
3
1 2
2
Person is a parent of Person , and thus is one generation away from Person .
Person is a parent of Person , and thus is two generations away from Person .
Therefore, the answer is .
10
1 2 3 4 5 6 7 8 9
9