#Q110. 「一本通 3.7 练习 2」Ant Trip

「一本通 3.7 练习 2」Ant Trip

Description

Original Source: 2009 Multi-University Training Contest 12 - Host by FZU

You are given an undirected graph with NN vertices and MM edges. It is guaranteed that all MM edges are distinct and there are no self-loops. The question is: what is the minimum number of strokes required to draw all the edges without lifting the pen from the paper?

Input Format

Multiple test cases, separated by blank lines.
For each test case, the first line contains two integers NN and MM, representing the number of vertices and edges, respectively. The next MM lines each contain two integers aa and bb, indicating an edge between aa and bb.

Output Format

For each test case, output the answer.

Sample 1

3 3
1 2
2 3
1 3

4 2
1 2
3 4

1
2

Constraints and Notes

$1 \le N \le 10^5,0 \le M \le 2\times 10^5,1 \le a,b \le N$