Every season at the quartz ridge of Glimmerfell, someone must optimize the storeroom layout. This year the task falls to Elowen, armed only with the tunnels register. Task: A tree has n nodes and n-1 unweighted edges. Print its diameter (in edges). Input format: First line: n. Next n-1 lines: u v. Output format: Print the diameter. Constraints: 1 <= n <= 1102; the input is a connected tree.
Example 1:
Example 2:
Example 3:
Constraints:
1 <= n <= 1102; the input is a connected tree.
