# Longest path

Very easy

Execution time limit is 1 second

Runtime memory usage limit is 256 megabytes

Given a directed acyclic graph, the task is to find the longest path in it.

## Input

The first line of the input file contains two natural numbers $n$ and $m$ - the number of vertices and arcs in the graph, respectively $(n≤10000,m≤100000)$. The next $m$ lines contain descriptions of the arcs, one per line. Arc number $i$ is described by two natural numbers $b_{i}$ and $e_{i}$ - the start and end of the arc, respectively $(1≤b_{i},e_{i}≤n)$.

The input graph contains no cycles or loops.

## Output

The first line of the output file should contain a single natural number - the number of arcs in the longest path.

## Examples

Input #1

Answer #1

Submissions 510

Acceptance rate 29%