QOJ.ac

QOJ

Time Limit: 1 s Memory Limit: 1024 MB
[0]

# 3699. Vertex Cover

统计

frog has a graph with n vertices v(1),v(2),,v(n) and m edges (v(a1),v(b1)),(v(a2),v(b2)),,(v(am),v(bm)).

She would like to color some vertices so that each edge has at least one colored vertex.

Find the minimum number of colored vertices.

Input

The input consists of multiple tests. For each test:

The first line contains 2 integers n,m (2n500,1mn(n1)2). Each of the following m lines contains 2 integers ai,bi (1ai,bin,aibi,min)

Output

For each test, write 1 integer which denotes the minimum number of colored vertices.

Sample Input

3 2
1 2
1 3
6 5
1 2
1 3
1 4
2 5
2 6

Sample Output

1
2