#agc011c. [agc011_c]Squared Graph

[agc011_c]Squared Graph

Problem Statement

Takahashi has received an undirected graph with NN vertices, numbered 11, 22, ..., NN. The edges in this graph are represented by (ui,vi)(u_i, v_i). There are no self-loops and multiple edges in this graph.

Based on this graph, Takahashi is now constructing a new graph with N2N^2 vertices, where each vertex is labeled with a pair of integers (a,b)(a, b) (1leqaleqN1 \\leq a \\leq N, 1leqbleqN1 \\leq b \\leq N). The edges in this new graph are generated by the following rule:

  • Span an edge between vertices (a,b)(a, b) and (a,b)(a', b') if and only if both of the following two edges exist in the original graph: an edge between vertices aa and aa', and an edge between vertices bb and bb'.

How many connected components are there in this new graph?

Constraints

  • 2leqNleq100,0002 \\leq N \\leq 100,000
  • 0leqMleq200,0000 \\leq M \\leq 200,000
  • 1lequi<vileqN1 \\leq u_i < v_i \\leq N
  • There exists no pair of distinct integers ii and jj such that ui=uju_i = u_j and vi=vjv_i = v_j.

Input

The input is given from Standard Input in the following format:

NN MM u1u_1 v1v_1 u2u_2 v2v_2 : uMu_M vMv_M

Output

Print the number of the connected components in the graph constructed by Takahashi.


Sample Input 1

3 1
1 2

Sample Output 1

7

The graph constructed by Takahashi is as follows.


Sample Input 2

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

Sample Output 2

18