#agc016e. [agc016_e]Poor Turkeys

[agc016_e]Poor Turkeys

Problem Statement

There are NN turkeys. We number them from 11 through NN.

MM men will visit here one by one. The ii-th man to visit will take the following action:

  • If both turkeys xix_i and yiy_i are alive: selects one of them with equal probability, then eats it.
  • If either turkey xix_i or yiy_i is alive (but not both): eats the alive one.
  • If neither turkey xix_i nor yiy_i is alive: does nothing.

Find the number of pairs (i,j)(i,\\ j) (1i<jN1 ≤ i < j ≤ N) such that the following condition is held:

  • The probability of both turkeys ii and jj being alive after all the men took actions, is greater than 00.

Constraints

  • 2N4002 ≤ N ≤ 400
  • 1M1051 ≤ M ≤ 10^5
  • 1xi<yiN1 ≤ x_i < y_i ≤ N

Input

Input is given from Standard Input in the following format:

NN MM x1x_1 y1y_1 x2x_2 y2y_2 :: xMx_M yMy_M

Output

Print the number of pairs (i,j)(i,\\ j) (1i<jN1 ≤ i < j ≤ N) such that the condition is held.


Sample Input 1

3 1
1 2

Sample Output 1

2

(i,j)=(1,3),(2,3)(i,\\ j) = (1,\\ 3), (2,\\ 3) satisfy the condition.


Sample Input 2

4 3
1 2
3 4
2 3

Sample Output 2

1

(i,j)=(1,4)(i,\\ j) = (1,\\ 4) satisfies the condition. Both turkeys 11 and 44 are alive if:

  • The first man eats turkey 22.
  • The second man eats turkey 33.
  • The third man does nothing.

Sample Input 3

3 2
1 2
1 2

Sample Output 3

0

Sample Input 4

10 10
8 9
2 8
4 6
4 9
7 8
2 8
1 8
3 4
3 4
2 7

Sample Output 4

5