You are given an undirected graph . Let us define a square as any cycle of length exactly four in . Can you count the number of squares in ?
Input consists of several cases. Every case begins with two natural numbers and , which are respectively the number of vertices and the number of edges of . Follow pairs to indicate that there is an edge connecting vertices and . Assume and . Vertices are numbered starting at 0. There are no edges of the kind , nor repeated edges.
For every given , print its number of squares.
Input
4 4 0 1 1 2 2 3 3 0 6 5 0 1 0 2 1 2 2 4 4 5 5 7 0 1 2 0 0 3 4 1 2 4 3 4 2 1
Output
1 0 3