To enjoy their summer vacations, Rikka and Yuta decide to go travels. According to past experiences, contradictions always arose when they were planning for the same trip. This time, they decide to make plans dividually and will go travel twice.
Coincidentally, they choose the same country Fantasy as the destination, which is a small island country on the Pacific. There are n cities in Fantasy and they are connected with n−1 two-way roads. It is guaranteed that any two cities can reach each other by the road system.
Though Rikka and Yuta love travels, visiting the same city more than once is still boring for them. Therefore, both Rikka and Yuta choose a simple path (i.e., a path without visiting any city more than once) as her/his plan. Moreover, they want to ensure the two paths do not intersect on any city.
Suppose Rikka chooses the path from a to b, Yuta chooses the path from c to d (both a=b and c=d are allowed), they define the feature of the plan is an ordered pair (L(a,b),L(c,d)), where L(x,y) represents the number of cities on the path from x to y.
Now, Rikka wants to count the number of different features, i.e., the number of different integer pairs (l1,l2) which satisfies there exists a valid travel plan (a,b,c,d)meets L(a,b)=l1,L(c,d)=l2. Since Rikka and Yuta are busy with planning their trip, Rikka asks you to help her calculate the answer.