Tree Cutting
문제
A country has cities numbered from to and bidirectional highways. It is possible to travel from any city to any other city using only the highways.
The distance between two cities and is defined as the number of highways required to travel from to .
The governor has decided to demolish a highway and build another highway such that the largest distance between any two cities is maximized.
Find this maximum largest distance.
입력
Your Program must read from standard input.
The first line contains an integer, , the number of cities.
In the next lines, each line contains distinct integers and , representing a highway connecting cities and .
출력
Your program must print to standard output.
The output should contain a single integer on a single line, the new largest distance between any two cities.
예제
예제 1
4 1 2 1 3 3 4
3
예제 2
6 1 2 2 3 2 5 4 5 5 6
5