Bicycle Race

Time limit1sMemory limit128 MB

Problem

There is a connected graph with N cities and M bidirectional roads. The cities are numbered from 1 to N.

We use the following terms.

  • A path is a sequence of roads where the destination city of each road is the starting city of the next road.
  • A simple path is a path that does not visit the same city more than once.
  • A ring is a simple path whose starting city and ending city are the same.

There is at least one path between every pair of cities, and each road belongs to at most one ring.

You want to build a race route that ends at city 1 while using each road at most once. The starting city may be any city, and the same city may be visited multiple times. Find the maximum possible length of such a route. The length of a route is the number of roads used.

Input

The first line contains the number of cities N and the number of roads M. (2 ≤ N ≤ 10,000, 1 ≤ M ≤ 2N - 2)

Each of the next M lines contains two different integers A and B. (1 ≤ A, B ≤ N) This means there is a bidirectional road between city A and city B. No two roads connect the same pair of cities.

Output

Print the length of the longest race route that ends at city 1.