{"raw_statement":[{"iden":"problem statement","content":"There is a tree with $N$ vertices, numbered $1$ through $N$.\nThe $i$\\-th of the $N-1$ edges connects the vertices $p_i$ and $q_i$.\nAmong the sequences of distinct vertices $v_1, v_2, ..., v_M$ that satisfy the following condition, find the maximum value of $M$.\n\n*   For every $1 \\leq i < M$, the path connecting the vertices $v_i$ and $v_{i+1}$ do not contain any vertex in $v$, except for $v_i$ and $v_{i+1}$."},{"iden":"constraints","content":"*   $2 \\leq N \\leq 10^5$\n*   $1 \\leq p_i, q_i \\leq N$\n*   The given graph is a tree."},{"iden":"input","content":"The input is given from Standard Input in the following format:\n\n$N$\n$p_1$ $q_1$\n$p_2$ $q_2$\n:\n$p_{N-1}$ $q_{N-1}$"},{"iden":"sample input 1","content":"4\n1 2\n2 3\n2 4"},{"iden":"sample output 1","content":"3"},{"iden":"sample input 2","content":"10\n7 9\n1 2\n6 4\n8 1\n3 7\n6 5\n2 10\n9 6\n2 6"},{"iden":"sample output 2","content":"8"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}