#D10562. Tree Separator
Tree Separator
Tree Separator
You are given a tree and an integer . You can choose arbitrary distinct two vertices and on . Let be the simple path between and . Then, remove vertices in , and edges such that one or both of its end vertices is in from . Your task is to choose and to maximize the number of connected components with or more vertices of after that operation.
Input
The input consists of a single test case formatted as follows.
:
The first line consists of two integers (). The following lines represent the information of edges. The ()-th line consists of two integers ( and for each ). Each is an edge of . It's guaranteed that these edges form a tree.
Output
Print the maximum number of connected components with or more vertices in one line.
Examples
Input
2 1 1 2
Output
0
Input
7 3 1 2 2 3 3 4 4 5 5 6 6 7
Output
1
Input
12 2 1 2 2 3 3 4 4 5 3 6 6 7 7 8 8 9 6 10 10 11 11 12
Output
4
Input
3 1 1 2 2 3
Output
1
Input
3 2 1 2 2 3
Output
0
Input
9 3 1 2 1 3 1 4 4 5 4 6 4 7 7 8 7 9
Output
2
inputFormat
Input
The input consists of a single test case formatted as follows.
:
The first line consists of two integers (). The following lines represent the information of edges. The ()-th line consists of two integers ( and for each ). Each is an edge of . It's guaranteed that these edges form a tree.
outputFormat
Output
Print the maximum number of connected components with or more vertices in one line.
Examples
Input
2 1 1 2
Output
0
Input
7 3 1 2 2 3 3 4 4 5 5 6 6 7
Output
1
Input
12 2 1 2 2 3 3 4 4 5 3 6 6 7 7 8 8 9 6 10 10 11 11 12
Output
4
Input
3 1 1 2 2 3
Output
1
Input
3 2 1 2 2 3
Output
0
Input
9 3 1 2 1 3 1 4 4 5 4 6 4 7 7 8 7 9
Output
2
样例
3 2
1 2
2 3
0