King Sejong

No attempts yetTime limit3sMemory limit512 MB

Problem

Sejong is the king of a solar system with nn planets. There are so many planets that he long ago gave up on naming them; instead each planet is identified by a number from 11 to nn. Sejong's home is on planet 11, and his favorite internet cafe is on planet 22.

To reach the cafe faster than anyone else and never miss a happy-hour event, Sejong keeps a private secret teleporter that directly connects planet 11 and planet 22. This secret teleporter is bidirectional and takes 250250 minutes for one trip.

Meanwhile, many public transit teleporters have been installed between the planets. Each transit teleporter is also bidirectional and takes exactly 11 hour (6060 minutes) per trip. To boost the economy, the citizens have asked Sejong to install even more transit teleporters.

Sejong wants to grant as many requests as possible, but he insists on one rule: using only transit teleporters, the shortest travel time between planet 11 and planet 22 must always stay strictly greater than 250250 minutes, so that his secret teleporter always remains the fastest route. Since one transit trip takes 6060 minutes, this means every path between the two planets must always use at least 55 transit teleporters.

Find the maximum number of additional transit teleporters that can be installed while keeping this rule. Installing a second teleporter between a pair of planets that are already directly connected is pointless, so it is never done: at most one teleporter joins any pair of distinct planets, and no teleporter connects a planet to itself.

Input

The first line contains the number of planets nn and the number of already installed transit teleporters mm, separated by a space. (2n400002 \le n \le 40000, 0m10000000 \le m \le 1000000)

Each of the next mm lines contains two distinct planet numbers uu and vv joined by a transit teleporter. (1u,vn1 \le u, v \le n, uvu \ne v) Sejong's secret teleporter is not included here. No pair of planets is listed more than once.

It is guaranteed that, using only the already installed transit teleporters, there is no route between planet 11 and planet 22 shorter than 250250 minutes along any path. (Longer routes may still exist.)

Output

Print, on one line, the maximum number of additional transit teleporters that can be installed while keeping the rule.

Hint

The figure above shows one example configuration. Solid lines are transit teleporters that are already installed, and dashed lines are transit teleporters that may still be added without breaking the rule.