Free Edges
Time limit1sMemory limit512 MB
Given an undirected graph, find the minimum number of edges to paint black so that repeatedly blackening a white edge incident to a vertex with exactly one white edge turns every edge black.
Problem
You have an undirected graph. Initially, all edges are white. You can choose some edges and paint them black.
After that, while there is a vertex such that exactly one white edge comes out of it, this white edge also becomes black.
Your goal is to choose the minimum possible number of edges to paint black such that, after the process is finished, all edges will be black.
Input
The first line of the input contains two integers and : the number of vertices and the number of edges in your graph ().
The next lines contain description of the edges of the graph. Each of these lines contains two integers and , describing an edge between vertices and (, ).
It is guaranteed that there are no multiple edges.
Output
Print one integer: the minimum possible number of edges you need to paint black such that, after the end of the described process, all edges will be black.