Byteotia has n towns connected by n−1 roads of equal length. The roads form a tree.
The king wants three luxury hotels in three different towns, all at the same pairwise distance. Count how many such triplets exist.
The first line contains n (1≤n≤5000). Each of the next n−1 lines contains two integers a and b (1≤a≤b≤n), the endpoints of a road.
Print the number of valid hotel triplets.