## Double Doors Regional P3 - Tudor and the Pusheens

View as PDF

Points: 7
Time limit: 1.0s
Java 2.5s
Memory limit: 256M

Problem type

Tudor likes pusheens!

Pusheen Boi has recently requested for a /pusheen command to be added in Slack, so that he can spam Slack with pusheens.

Meanwhile, Tudor's farm of servers has gotten to be rather large. There are pairs of servers that are connected and therefore can directly communicate with each other. A server can vacuously communicate with itself. All servers can communicate with each other, perhaps by using intermediate servers.

Pusheen Boi wants to make sure that he can send pusheens from server to server . Tudor, wanting to reduce the complexity of his server farm, wants to know the maximum number of pairs of servers that he can disconnect while still preserving Pusheen Boi's wishes.

#### Input Specification

The input starts with two integers and , .

pairs of lines follow, each containing two distinct integers and , indicating that servers and can communicate. You may assume and no edges appears more than once.

The final line of input contains two integers, and .

#### Output Specification

Output the maximum number of pairs of servers that can be disconnected, such that and can still communicate.

#### Sample Input

2 1
1 2
1 2

#### Sample Output

0