Number of paths#3643

Number of paths

1 second
122.174 megabytes
Very easy

Given a directed acyclic graph, your task is to partition the graph into the smallest number of vertex-disjoint paths. Each vertex must be included in exactly one path.

Input

The first line provides two integers: the number of vertices and the number of edges . The constraints are 1 \le n \le 500 and 0 \le k \le n \cdot (n - 1) / 2. The next lines each contain two integers, and (where 1 \le a, b \le n), representing a directed edge from vertex to vertex . Each edge is unique and appears only once.

Output

Print the minimum number of paths required.

Examples

Example 1

Loading
Loading