eolymp
bolt
Try our new interface for solving problems
Problems

Kingdom

Kingdom

In the fairy kingdom \textbf{N} cities. Some pairs of cities connected by roads, with one and that same pair of cities can connect several roads. Outside the cities the roads do not intersect. On every road you can go in any direction. Help the King to determine skoloi still need to build roads in the kingdom, that His Majesty was able to travel on all roads, not prooezzhaya twice on any of them. Usually (see example), he has to visit each city. Travel King should nachinatsya and ends with in the same city. \InputFile You enter the first number in the kingdom cites \textbf{N} (\textbf{1} ≤ \textbf{N} ≤ \textbf{100}) and the number of city pairs \textbf{K} (\textbf{1} ≤ \textbf{K} ≤ \textbf{10000}). Then, in groups of \textbf{3} to the number you enter the number of towns and number of roads connecting them (all the numbers do not exceed 100). \textbf{All} numbers rozdeleny space. \OutputFile You draw the smallest possible number of roads.
Time limit 1 second
Memory limit 64 MiB
Input example #1
7 6 1 2 1 1 3 1 4 1 3 4 2 5 3 4 3 5 6 2
Output example #1
3