Given a graph having N vertices and an array A of M undirected edges, find the number of pairs of indices (l,r),1≤l≤r≤M, in A, such that if we consider edges only from A[l],A[l+1],...,A[r], then the graph is connected.
Input Format:
First line consists of two space separated integers denoting N and M.
Following M lines consists of two space separated u and v, denoting an undirected edge.
Output Format:
Print the required answer.
Constraints:
1≤N,M≤105
1≤u,v≤N