The internet of Bytotia is a network of servers joined by one-way links. An attacker wants to cut off every route from server 1 to server n. The attacker can plant a trap on any link, and when a trap goes off it destroys the single link it sits on. The attacker uses as few traps as possible while still guaranteeing that no message can travel from server 1 to server n. Find that minimum number of traps.
The first line contains two integers n and m (2≤n≤10000): the number of servers and the number of links. Servers are numbered from 1 to n. Each of the next m lines contains two integers a and b (1≤a,b≤n, a=b), describing a one-way link from server a to server b. There is at most one direct link between any two servers.
Print a single integer: the minimum number of links that must be destroyed so that server 1 can no longer reach server n.