The Zookeeper has decided to arrest all the hedgehogs. As the hedgehogs stole from an orange tree, the prison will be in the form of a tree. There are N nodes (1 ≤ N ≤ 500000) and N-1 edges. Each node has exactly 1 hedgehog.
As hedgehogs are sociable creatures, each of them wants to send a message to every other hedgehog. Each message travels a distance equal to the number of edges traversed between the 2 corresponding hedghogs.
Help FNH find out the total distance travelled by all messages!
The first line of input contains 1 integer N
The next N-1 lines of input contains 2 integers a and b, representing an edge from node a to node b.
It is guaranteed that a tree will be formed from the egdes.
Output 1 integer, the total distance travelled by the messages