Byteman is studying directed graphs. He is especially fond of graphs that contain no directed cycles, because on such graphs many problems can be solved simply and efficiently. He now wants a way to represent any directed graph as a combination of acyclic graphs.
Given a directed graph, partition its set of edges into as few subsets as possible so that, for every subset, the directed graph formed by only those edges contains no directed cycle. Your task is to report that smallest possible number of subsets.
The first line contains two integers n and m (1≤n,m≤100,000): the number of vertices and the number of edges. The vertices are numbered from 1 to n. Each of the next m lines contains two integers ai and bi (1≤ai,bi≤n, ai=bi), describing a directed edge from vertex ai to vertex bi. The graph contains no multiple edges.
Print a single integer: the minimum number of acyclic subgraphs into which the edge set of the graph can be partitioned.

The picture illustrates the example. The circles are vertices and the lines and arcs (solid and dashed) are edges. The number next to each circle is the vertex number, and the number next to each line or arc is the edge number. The edges of this graph can be split into two acyclic graphs: the solid edges form the first one and the dashed edges form the second, so the answer for this graph is 2.