0.SR. Edges Adding


Submit solution

Points: 3 (partial)
Time limit: 1.0s
Memory limit: 98M

Author:
Problem type
Allowed languages
Ada, Assembly, Awk, C, C++, C11, CLANG, CLANGX, Classical, COBOL, Coffee, CSC, D lang, DART, F95, FORTH, Fortrn, GAS32, GO, Haskell, Itercal, Java, kotlin, LEAN, LISP, LUA, MONOVB, Nasm, OCAML, Pascal, Perl, php, PIKE, prolog, Pypy, Python, Ruby 2, RUST, Scala, SCM, SED, SWIFT, TCL, TUR, V8JS, VB, ZIG

An is obseving an undirected graph. He wonders if there exits in this graph 2 vertices that connecting these 2 vertices will create exactly one more simple cycle. Recall that a simple cycle may be de?ned either as a sequence of vertices with no repetitions of vertices and edges allowed, other than the repetition of the starting and ending vertex, with each two consecutive vertices in the sequence adjacent to each other in the graph. Your task is to help An count the number of pairs of vertices satisfying the conditions above.

Input

The ?rst line consist of two positive integers n;m (n;m ? 105) which are the number of vertices and the number of edges of the given graph.

Each line in the m following lines contains two positive integers u; v (u; v ? n) which are two vertices connected by an edge.

Output

You should output on a single line an unique integer that is the number of pairs you found.

Example 1

INPUT

5 4 1 2

2 3

3 4

4 5

OUTPUT

6

Example 2

INPUT

5 5

1 2

2 3

1 3

3 4

4 5

OUTPUT

1

a. Container b. Three rectangle items c. Solution


Comments

There are no comments at the moment.