Given a directed acyclic graph, the task is to find the longest path in it.
The first line of the input file contains two natural numbers and — the number of vertices and arcs in the graph, respectively (n \leq 10000,\ m \leq 100000). The next lines contain descriptions of the arcs, one per line. Arc number is described by two natural numbers b_i and e_i — the start and end of the arc, respectively (1 \leq b_i,\ e_i \leq n).
The input graph contains no cycles or loops.
The first line of the output file should contain a single natural number — the number of arcs in the longest path.
Example 1