E. Earthquake
time limit per test
1.5 seconds
memory limit per test
256 megabytes
input
standard input
output
standard output

An earthquake has once again struck IME (commonly referred to as the Institute of Manifold Earthquakes), and every time this happens, some hallways end up simply being destroyed. Since another earthquake will probably happen shortly after, the commander is only open to building what is necessary in order for IME to be connected once again.

The layout of the institute can be thought of as a series of rooms and pathways, where pathways strictly connect two different rooms, and that there are no redundant pathways. Since the commander is indeed, the commander, he orders you to help him find out what's the smallest amount of hallways that need to be built given the map of the current situation.

Input

The first line of the input consists of two integers, $$$n$$$, $$$m$$$ $$$(1 \leq n \leq 10^5)$$$ $$$(0 \leq m \leq \min(10^6, \frac{n \times (n - 1)}{2})$$$ — the amount of rooms in IME and the amount of pathways that still remain after the earthquake.

The next $$$m$$$ lines consist of two integers, $$$a$$$, $$$b$$$ $$$(1 \leq a, b \leq n)$$$, $$$(a \neq b)$$$ — indicating that rooms $$$a$$$ and $$$b$$$ are still connected after the earthquake.

Output

Output a single integer — the smallest amount of hallways that need to be built in order for IME to be connected.

Examples
Input
5 4
1 2
3 4
1 3
2 4
Output
1
Input
7 5
1 2
2 3
3 1
4 5
6 7
Output
2