Tree with small distances
You are given an undirected tree consisting of vertices. An undirected tree is a connected graph with edges.
Your task is to add the minimum number of edges in such a way that the length of the shortest path from vertex to any other vertex is at most . Note that you are not allowed to add loops or multiple edges.
Input
The first line contains one integer — the number of vertices in the tree.
The next lines describe the edges: the -th edge is specified as a pair of vertices . It is guaranteed that the given graph is a tree. It is guaranteed that there are no loops or multiple edges among the given edges.
Output
Print a single integer — the minimum number of edges that need to be added in order to ensure that the length of the shortest path from vertex to any other vertex does not exceed . Note that you cannot add loops or multiple edges.