Tecnoesis'16 is going on in NIT Silchar. Under the fun module there is one event Magical Islands. In this game you'll be given one real life map and the map is represented by N nodes and M edges. There're are some directed simple path that connects node u to node v. Maps contains some nodes which are magical, means if you start from those nodes and each time if you choose only one edge connected from it then you can visit at most X nodes(including the start node). Also if you keep moving infinite amount of time you may visit same X nodes multiple no of times.
So, always you would like to visit maximum no of nodes. So, you have to choose a start node such that X is maximum. Find the value of maximum X possible in given map.
First line contains two integers N and M, no of nodes and no of edges. Next M lines contains two integers u and v. There is a directed edge from u to v.
Print single integer X.
1 ≤ N ≤ 100000, 1 ≤ M ≤ 200000 1 ≤ u, v ≤ N
Problem Setter : Sourav Kumar Paul
If you choose any node except node 5 you can visit at most 4 nodes which is maximum.
Suppose you start from node 1. 1 -> 2 -> 3 -> 4 -> 2 -> ....