L. Ladybug And The Bullet Train
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

Ladybug is an agent specialized in snatch-and-grab jobs, now he has a job that requires him to go to station $$$X$$$ and grab a certain suitcase, starting from station 1.

To do that he will be travelling through the stations via a bullet train, so he can move from station $$$A$$$ to station $$$B$$$ if and only if there exists a train line that connects such stations, it is always possible to reach any station from any other station and that path is unique.

One thing about agent ladybug is that he has very bad luck, he forgot the map of the train lines in the taxi, so, he does not know how to get to station $$$X$$$ from his initial station, the lack of a map will not stop him, he will travel through the stations without the map, knowing that eventually he will reach his destination.

Each station has signs that indicate what other stations are reachable taking a train from there. If the agent hasn't already reached station $$$X$$$, he will need to pick an arbitrary station to go to. He will not pick a station he has already visited, except if he reached a dead end (he cannot go to a new station) and return from where he came from.

It's guaranteed that he will at some point reach the station $$$X$$$ with this method, but because he has very bad luck, that will end up taking him the longest amount of rides possible. Help his contractor know how many rides the agent has to take to reach station $$$X$$$.

Note:

- A ride is a movement between stations.

- If station $$$Y$$$ has a sign that indicates the agent can reach station $$$X$$$ taking a train from that station, the agent will take that train first.

Input

The first contains two integers separated by a space $$$N$$$ ($$$2 \leq N \leq 10^6$$$) and $$$X$$$ ($$$2 \leq X \leq N$$$), indicating the number of stations in train network and the station where the agent should grab the suitcase. Each of the next $$$N - 1$$$ lines contains two integer numbers $$$A$$$ and $$$B$$$ ($$$1 \leq A, B \leq N$$$), indicating that there is a sign at station $$$A$$$ which indicates there is a train the agent can use to reach station $$$B$$$ from $$$A$$$, and viceversa.

Output

Print one line with an integer number, representing the amount of rides the agent needs to take to reach station $$$X$$$.

Examples
Input
5 5
1 2
2 3
3 4
4 5
Output
4
Input
7 4
2 1
3 1
2 4
2 5
3 6
3 7
Output
8
Input
2 2
1 2
Output
1