Recent studies have shown that there is indeed intelligent life on Mars. The problem is that now humanity is at war with the Martians and our best bet for survival is that we need to strike first. On Mars there is a complex railroad system of cities connected by bidirectional railroads.
Earth has called upon the best bomber there is, mister RANDy, to strike down those railroads. Because he is a maniac, he only has one bomb left so he can only strike down a single one of those railroads. RANDy will only target strategic railroads. A railroad is strategic if and only if there exists a pair of cities () such that you can reach from and after bombing the given railroad, you can no longer reach from .
The Martians are starting to pick up on our plan, so they are now constructing additional railroads. After the construction of each new railroad, RANDy wants to know how many strategic railroads there are. RANDy now asks you to help him find the answer he seeks.
Input
The input will contain on the first line , the number of cities on the Martian surface, , the number of railroads connecting those cities and , the number of additional railroads that the Martians will be constructing.
On the next lines you will find a pair (), meaning that there is a bidirectional railroad from city to city .
On the next lines you will find a pair (), meaning that the Martians will construct a railroad from city to city .
Output
The output will contain lines, the line will contain a single number , representing the number of strategic railroads after the Martians have constructed the first new railroads.
Constraints
- The graph is not guaranteed to be connected
- For tests worth points,
- For tests worth more points,
- The scores from the contest might be different than the scores you get here
Example 1
stdin
5 4 2
5 1
3 2
2 5
4 2
1 2
5 3
stdout
2
1
Explanation
For the first sample, after the first built railroad, the strategic railroads are () and (). After the second built railroad, the only strategic railroad is ().
Example 2
stdin
6 5 2
5 1
3 2
2 5
4 2
1 2
4 3
6 5
stdout
0
1