You are given a tree with vertices numbered .
Perform the following operation exactly once to obtain a new tree .
For a tree , let denote the distance between vertices and . Define the between and as the number of unordered vertex pairs satisfying
Find the minimum possible amount of change.
The input is given from Standard Input in the following format:
For each test case, print the minimum possible amount of change on one line.
Each case is given in the following format:
For each , there is an edge connecting vertices and .
Every vertex has degree at most .
| 5 | 35 | No additional constraints. |