In the kingdom of Arbolia, cities are connected by roads. There is exactly one simple route between any two cities, so the road network forms a tree.
Mira wants to compress this network into a single super-city. She may repeatedly merge any two distinct cities into one new city, even if they are not directly connected by a road.
During this process, every pair of remaining cities has one of three possible relationships:
- a black edge,
- a red edge, or
- no edge.
Initially, every road is a black edge, all other pairs have no edge, and there are no red edges.
Suppose Mira merges cities and into a new city . For each other remaining city , the relationship between and is determined as follows:
- If at least one of the relationships or is a red edge, becomes a red edge.
- Otherwise, if both relationships are black edges, is a black edge.
- Otherwise, if both relationships have no edge, has no edge.
- In all other cases, becomes a red edge.
The two old cities and all their relationships disappear after the merge.
The red degree of a city is the number of red edges incident to it. Mira wants to merge all cities into one while keeping the red degree of every city, at every moment, as small as possible.
Find the smallest integer for which Mira can perform all merges without any city ever having red degree greater than .
Input
The first line contains a single integer () --- the number of cities.
Each of the next lines contains two integers and (, ), describing a road between cities and .
It is guaranteed that the given roads form a tree.
Output
Print a single integer: the minimum possible value of .
Example
stdin
4
4 3
2 1
4 2
stdout
1
Note
In the first example, there are cities connected by roads: , , and . These roads form the path .
The answer is , meaning that it is possible to merge all cities into a single city while ensuring that, at every moment, each remaining city has at most one incident red edge.
However, it is impossible to complete the process without creating any red edges. Therefore, the minimum possible value of is .