Covering with paths#5299

Covering with paths

1 second
128 megabytes
Easy

Given an oriented acyclic graph, find the minimum number of disjoint paths that cover all vertices.

Input

The first line of input contains the number of vertices and the number of edges (2 \leq n \leq 1000, 0 \leq m \leq 10^5). Each of the next lines contains two numbers: the numbers of the vertices and connected by a directed edge (, ).

Output

In the first line of output print a natural number representing the minimum number of paths needed to cover all the vertices.

Examples

Example 1

Loading
Loading