Sword Counting

아직 제출이 없습니다시간 제한5초메모리 제한1024 MB

문제

Michael is planning to open a graph store. A graph store is a type of store which specializes in selling various graphs in different sizes and shapes. Michael has done extensive research on the market and the business seems very profitable. He has also invented a graph generator device which is able to produce any graph that he wants.

However, there is one small problem which is keeping him from starting the next booming business: Michael does not know how each graph should be priced. After weeks of reading, he found that a graph’s value can be calculated based on the number of its sword subtrees. A group of six distinct vertices (let’s represent them with letters A to F) form a sword subtree if the following edges exist between them (see figure):

  • A is connected to B.
  • B is connected to A and D.
  • C is connected to D.
  • D is connected to B, C, E, and F.
  • E is connected to D.
  • F is connected to D.

Two sword subtrees T_1T\_1 and T_2T\_2 are considered to be different if there is any edge e which exists in T_1T\_1 but does not exist in T_2T\_2.

As a highly knowledgeable person and his business partner, your task is to help Michael count the number of sword subtrees in his generated graphs. Given an undirected graph, write a program to count the number of its sword subtrees.

입력

The first line of input will contain two integers NN and MM, (1N,M100,0001 ≤ N, M ≤ 100\\,000), representing the number of vertices and edges in the graph. The next MM lines each will contain two integers u_iu\_i and v_iv\_i (1u_i,v_iN1 ≤ u\_i, v\_i ≤ N), the endpoints of an undirected edge. It is guaranteed that the graph described by these edges does not contain multiple edges or self loops.

출력

Output a single integer, the number of sword subtrees in the given graph.