There is a directed graph with vertices and edges. The vertices are numbered , and for each , the -th directed edge goes from vertex to vertex .
does not contain directed cycles.
Find the length of the longest directed path in . Here, the length of a directed path is the number of edges in it.
The first line contains two integers: number of vertices and number of edges . Each of the next lines contains two integer that describe the edge of the graph.
Print the length of the longest directed path in .