You are given an undirected graph that contains nodes and edges. It is also mentioned that does not contain any cycles. A sequence of nodes is special if distance , and all are distinct. Determine the size of a maximal special sequence. Hence, the one with maximum .
Note
Input format
Output format
Print the maximum value of .
Constraints
This graph is not connected. Two separate components are formed denoted as follows:
In this case, the maximal beautiful sequence is of length .