You are given a simple undirected graph. Determine the maximum number of edges you can remove so that the number of connected components stays exactly the same as it is now. Equivalently, this is the number of edges that lie on cycles: m - (n - c) where c is the current number of connected components.
Input format
Line 1: two integers n and m (nodes and edges). Nodes are numbered 1..n.
Next m lines: two integers u v describing an undirected edge (no self-loops, no repeated edges).
Output format
One line: the maximum number of removable edges.
Constraints
- 1 <= n <= 2000
- 0 <= m <= n*(n-1)/2