Christmas is coming. XiaoYang has got a big Christmas tree, and he wants to decorate it.
XiaoYang loves Shiny things. He set up a net of light bulbs on the tree. n light bulbs are connected by m wires. But the bulbs and wires are strange. Each bulb has a switch. If the switch is turned, some bulbs connecting this one will also be switched. The switch operation only flows from the left end to the right end. More precisely, a wire connects u and v so that when the switch of u is turned, the switch of v is turned also. Note that a switch will be turned only once in one step.
Now only the bulb 1 is on. How many steps does it take to turn off all the bulbs?
The first line contains two integers n and
-- the number of bulbs and wires in the net.
Each of the next m lines contains two space-separated integers u andthat mean there's a directed wire connecting the left u and the right v. It's guaranteed that the net is connected, acyclic and doesn't contain any self-loops or multiple edges.
One line with an integer denoting the answer.
Operation a (b1, b2, ..., bm) means switch bulb a in this step, and then bulb b1, b2, ..., bm are affected.It is guaranteed that control can flow from bulb 1 to any other bulbs.