Problem hidden
This problem was hidden by Editorial Board member probably because it has incorrect language version or invalid test data, or description of the problem is not clear.

EITRGROUP - TOURISM

 

ABC company has n employees numbered from 0. Each employee is managed by up to 1 other employee and has no cross-management (No trio exists: A manages B, B manages C, C manager A). The company wants to organize travel for its employees but the staff does not want to go with their superiors (the direct manager or higher) because they feel uncomfortable. The company will need to organize at least how many groups so there are no employees and superiors in the same group.
Note that the company has a director, not managed by any other employee.

ABC company has n employees numbered from 0. Each employee is managed by up to 1 other employee and has no cross-management (No trio exists: A manages B, B manages C, C manages A). The company wants to organize travel for its employees but the staff does not want to go with their superiors (the direct manager or higher) because they feel uncomfortable. The company will need to organize at least how many groups so there are no employees and superiors in the same group.

Note that the company has a director, not managed by any other employee.

Input

The first line contains the number of employees n, m (0 ≤ n, m ≤ 105) the number of employees and the number of management relationships.

The next m lines contain two integers u, v representing u as a direct manager of v.

Output

Minimum number of groups.

Example

Input:
5 4
2 4
4 1
3 2
3 0

Output:
4

Added by:Ha Minh Ngoc
Date:2018-07-29
Time limit:1s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:CSHARP C++ 4.3.2 CPP CPP14 CPP14-CLANG FSHARP GO JAVA JS-MONKEY NODEJS PHP PYTHON PYPY PYPY3 PYTHON3 RUBY SQLITE SWIFT VB.NET
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.