Chain repairing
Sovunya had a chain consisting of n links, numbered from 1 to n. But while the chain was lying in the chest of drawers, it was all tangled. Sovunya wants to rectify the situation.
Each link is a ring of wire. Every two links are either linked to each other or not. Sovunya turned to Pin for help. He can do two things:
Unforge one of the links. At the same time, it ceases to be a closed ring, and therefore it can be disconnected from all other links.
Resolder the previously unforged link. In this case, it becomes a closed ring again. Pin can choose an arbitrary set of other links, thread the current link through them before sealing, and thus chain this link to each link from the selected set.
At the end, all links must be soldered.
Sovunya wants link number 1 to be linked with link number 2, 2 with 3, . . . , n - 1 with n. In other words, links with numbers i and i + 1 must be linked for all i ∈ [1, n - 1]. And no other pairs of links should be linked.
Help Pin determine the minimum number of steps he have to perform to fix the chain.
Input
The first line contains two integers n and m (1 ≤ n ≤ 40, 0 ≤ m ≤ * n* * (n - 1) / 2) - the number of links and the number of pairs of initially linked links.
The next m lines contain two integers a[i]
and b[i]
(1 ≤ a[i]
, b[i]
≤ **n **, a[i]
≠ b[i]
) - numbers of linked links.
It is guaranteed that each unordered pair of links occurs at most once in the input.
Output
Print one integer - the minimum number of actions that Pin must do to fix the chain.
Examples
Note
In the first example Pin can unforge link number 3. Then it will detach from both remaining links. And then, solder link number 3 back, coupling it only with link number 2.
In the second example, Pin can unforge link number 2, then solder it back by connecting it to links 1 and 3. And then, unforge link number 4 and solder back, connecting with links 3 and 5.