RevolC FaeLoN

Hopefully, you can remember Koorosh from one of the previous problems. Fortunately, Koorosh has solved Basm’s problem without your help! Now, he is a high-ranked advisor of Basm. As usual, Basm has conquered a new territory, called RevolC FaeLoN. In order to make the people of RevolC FaeLoN satisfied, he wants to solve one of their basic problems. The RevolC FaeLoN has a high annual rate of camel accidents and Basm wants to make the roads of this territory unidirectional in order to reduce the accident rate. He wants to do this task in such a way that each city has at least one path to every other city. Now, Basm has asked Koorosh to find the minimum number of unidirectional roads which need to be constructed (in addition to the task of making the existing roads unidirectional) in order for every city to be reachable from every other city. Note that the original graph representing the territory is simple but during the road construction process, extra roads can be constructed between two cities that have already been connected to each other by a road. Input Input consists of several test-cases. Each test case begins with two numbers 1 ≤ n ≤ 1000 and m which are the number of cities and roads of RevolC FaeLoN respectively. The next m lines, each contain two integers 1 ≤ u, v ≤ 1000, indicating that there is a road between u and v. The input is terminated by end of file. Output For each test-case, print the minimum number of roads that should be constructed to make Basm’s decision possible. Sample Input 32 12 23 10 11 12 23 31 37 45 56 64 79 63 98 78 Sample Output 1

2/2 2