#bzoj1006. 神奇的国度

神奇的国度

File IO: country. in/. out

Title Description

KK is a country that is fond of triangles, and even people only like the triangle principle in their interactions They believe that the triangular relationship, namely ABAB mutual recognition, BCBC mutual recognition, and CACA mutual recognition, is concise and efficient In order to consolidate the triangular relationship, K country prohibits the existence of quadrilateral relationships, pentagonal relationships, and so on The so-called N-edge relationship refers to the existence of only N pairs of cognitive relationships between NN individuals A1,A2,...AnA_1, A_2,... A_n : (A1,A2)(A2,A3)...(An,A1)(A_1, A_2) (A_2, A_3)... (A_n, A_1) , without any other cognitive relationships For example, a quadrilateral relationship refers to the four individuals AB,BC,CD,AB, BC, CD, and DADA knowing each other, while ACAC and BDBD do not know each other During the national competition, in order to prevent cheating, it is stipulated that any pair of people who know each other cannot be on the same team. The king knows at least how many teams can be divided.

Input format

The first line consists of two integers,NN and MM.

1N10000,1M10000001 \le N\le 10000, 1\le M \le 1000000 . Indicates the existence of NN individuals and MM for cognitive relationships Next MM line, enter a pair of friends on each line.

Output format

Output an integer indicating the minimum number of teams that can be divided

Example

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

Data scope and agreement

One solution (1,3)(2)(4)(1,3) (2) (4)