#D9465. Counting Cycles

    ID: 7867 Type: Default 4000ms 268MiB

Counting Cycles

Counting Cycles

Problem K Counting Cycles

Given an undirected graph, count the number of simple cycles in the graph. Here, a simple cycle is a connected subgraph all of whose vertices have degree exactly two.

Input

The input consists of a single test case of the following format.

nn mm u1u_1 v1v_1 ... umu_m vmv_m

A test case represents an undirected graph GG.

The first line shows the number of vertices nn (3n1000003 \leq n \leq 100 000) and the number of edges mm (n1mn+15n - 1 \leq m \leq n + 15). The vertices of the graph are numbered from 11 to nn.

The edges of the graph are specified in the following mm lines. Two integers uiu_i and viv_i in the ii-th line of these m lines mean that there is an edge between vertices uiu_i and viv_i. Here, you can assume that ui<viu_i < v_i and thus there are no self loops.

For all pairs of ii and jj (iji \ne j), either uiuju_i \ne u_j or vivjv_i \ne v_j holds. In other words, there are no parallel edges.

You can assume that GG is connected.

Output

The output should be a line containing a single number that is the number of simple cycles in the graph.

Sample Input 1

4 5 1 2 1 3 1 4 2 3 3 4

Sample Output 1

3

Sample Input 2

7 9 1 2 1 3 2 4 2 5 3 6 3 7 2 3 4 5 6 7

Sample Output 2

3

Sample Input 3

4 6 1 2 1 3 1 4 2 3 2 4 3 4

Sample Output 3

7

Example

Input

4 5 1 2 1 3 1 4 2 3 3 4

Output

3

inputFormat

Input

The input consists of a single test case of the following format.

nn mm u1u_1 v1v_1 ... umu_m vmv_m

A test case represents an undirected graph GG.

The first line shows the number of vertices nn (3n1000003 \leq n \leq 100 000) and the number of edges mm (n1mn+15n - 1 \leq m \leq n + 15). The vertices of the graph are numbered from 11 to nn.

The edges of the graph are specified in the following mm lines. Two integers uiu_i and viv_i in the ii-th line of these m lines mean that there is an edge between vertices uiu_i and viv_i. Here, you can assume that ui<viu_i < v_i and thus there are no self loops.

For all pairs of ii and jj (iji \ne j), either uiuju_i \ne u_j or vivjv_i \ne v_j holds. In other words, there are no parallel edges.

You can assume that GG is connected.

outputFormat

Output

The output should be a line containing a single number that is the number of simple cycles in the graph.

Sample Input 1

4 5 1 2 1 3 1 4 2 3 3 4

Sample Output 1

3

Sample Input 2

7 9 1 2 1 3 2 4 2 5 3 6 3 7 2 3 4 5 6 7

Sample Output 2

3

Sample Input 3

4 6 1 2 1 3 1 4 2 3 2 4 3 4

Sample Output 3

7

Example

Input

4 5 1 2 1 3 1 4 2 3 3 4

Output

3

样例

4 5
1 2
1 3
1 4
2 3
3 4
3