Winter#7236

Winter

0.5 seconds
64 megabytes
Easy

The country of Uzhlandia is famous for its impeccable roads, but this year's unusually cold and snowy winter has taken its toll. Some roads are now blocked for motorists, disrupting the connections between cities. In Uzhlandia, two cities are considered connected if you can travel from one to the other via unblocked roads, possibly passing through other cities.

A neighboring state, renowned for its unique heaters, has decided to offer humanitarian aid to Uzhlandia. The plan is to deliver heaters by helicopter, which will then be distributed to the cities by trucks. Since aviation fuel is costly, it is necessary to minimize the number of helicopter landings, ensuring each city receives the necessary heaters. Your task is to calculate the minimum number of helicopter landings required to achieve this.

Input

The first line contains two integers and (1 \leq N \leq 100\,000, 0 \leq M \leq 200\,000) — the number of cities in Uzhlandia and the number of unblocked roads, respectively. The next lines each contain two integers and (1 \leq i, j \leq N), indicating that the road between cities and is unblocked. The cities are numbered from to .

Output

Output a single integer: the minimum number of helicopter landings required.

Examples

Example 1

Loading
Loading

Note

Cities , , and are interconnected, so one landing in any of these cities is sufficient to supply them with heaters, which can then be distributed by trucks. Similarly, cities and are connected, requiring another landing. Finally, city is isolated and needs a separate helicopter landing to receive heaters. In total, landings are necessary.