Saitama, for Christmas, wants an undirected tree. Each edge in the node has been given a weight of , and therefore, means that the distance between node and is the number of edges on an acyclic path from to .
Unfortunately, Saitama will only like his present if it's diameter is at most . The diameter of a tree is the maximum distance between any two vertices.
The undirected tree Saitama received has vertices, labelled through . You want to remove an amount of vertices (or, you don't have to remove any if Saitama likes his present), such that the resulting tree is one Saitama likes. If you remove a node, all edges that are connecting to it will disappear as well.
As you are lazy, you want to find out the minimum number of vertices to remove in order to make Saitama happy, else you get One Punched!
Constraints
- , such that and are nodes that are connected.
- The graph will be a tree.
Input Specification
The first line of input will contain 2 space separated integers, and .
The next lines will contain two space separated integers, and , denoting a connection between and that is bidirectional.
Output Specification
You are to output a single integer, the minimum number of nodes that you have to remove to make Saitama happy.
Sample Input 1
6 2
1 2
3 2
4 2
1 6
5 6
Sample Output 1
2
Comments