Covering with paths
Easy
Execution time limit is 1 second
Runtime memory usage limit is 128 megabytes
An oriented acyclic graph is given. Find the minimum number of disjoint paths covering all vertices.
Input
First line contains number of vertices n and number of edges m (2 ≤ n ≤ 1000, 0 ≤ m ≤ 10^5
). Each of the next m lines contains two numbers: the numbers of the vertces u and v connected with an edge (u, v).
Output
Print the minimum number of paths that can cover all the vertices.
Examples
Input #1
Answer #1
Submissions 915
Acceptance rate 21%