A strongly connected component in a directed graph is an arbitrary set of vertices such that from any vertex of this set there is a path to any other vertex of this set, and there is no other set with a similar property containing this set.
Given a directed graph. Find the number of strongly connected components in it.
The first line contains two integers and — number of vertices and edges in the graph, respectively. The next lines describe the edges: -th of these lines contains two integers and — the start and the end of the -th edge respectively. It is guaranteed that the graph has no loops or multiple edges.
Print the number of strongly connected components in the graph.