#abc288c. [abc288_c]Don’t be cycle
[abc288_c]Don’t be cycle
Problem Statement
You are given a simple undirected graph with vertices and edges. The vertices are numbered to , and the -th edge connects vertex and vertex . Let us delete zero or more edges to remove cycles from the graph. Find the minimum number of edges that must be deleted for this purpose.
What is a simple undirected graph? A simple undirected graph is a graph without self-loops or multi-edges whose edges have no direction.
What is a cycle? A cycle in a simple undirected graph is a sequence of vertices of length at least satisfying if such that for each , there is an edge between and .
Constraints
- The given graph is simple.
- All values in the input are integers.
Input
The input is given from Standard Input in the following format:
Output
Print the answer.
Sample Input 1
6 7
1 2
1 3
2 3
4 2
6 5
4 6
4 5
Sample Output 1
2
One way to remove cycles from the graph is to delete the two edges between vertex and vertex and between vertex and vertex .
There is no way to remove cycles from the graph by deleting one or fewer edges, so you should print .
Sample Input 2
4 2
1 2
3 4
Sample Output 2
0
Sample Input 3
5 3
1 2
1 3
2 3
Sample Output 3
1