Problem: You are given a tree $T$ and an integer $K$. You can choose arbitrary distinct two vertices $u$ and $v$ on $T$. Let $P$ be the simple path between $u$ and $v$. Then, remove vertices in $P$, and edges such that one or both of its end vertices is in $P$ from $T$. Your task is to choose $u$ and $v$ to maximize the number of connected components with $K$ or more vertices of $T$ after that operation.



Input

The input consists of a single test case formatted as follows.


$N$ $K$
$u_1$ $v_1$
:
$u_{N-1}$ $v_{N-1}$


The first line consists of two integers $N, K$ ($2 \leq N \leq 100,000, 1 \leq K \leq N$). The following $N-1$ lines represent the information of edges. The ($i+1$)-th line consists of two integers $u_i, v_i$ ($1 \leq u_i, v_i \leq N$ and $u_i \ne v_i $ for each $i$). Each $\\{u_i, v_i\\}$ is an edge of $T$. It's guaranteed that these edges form a tree.

Output

Print the maximum number of connected components with $K$ 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

Solution (in CPP):

Solution:
#include "bits/stdc++.h"

#pragma warning(disable:4996)
using namespace std;
using ld =long double;

int ans=0;

int N, K;
pair<int,int> dfs(const vector<vector<int>>&edges, const int now, const int from) {
	int sum=0;
	vector<int>v(2,0);
	int one_num=0;
	int ch_num=1;
	bool flag=false;
	int ch_big_num=0;
	for (auto e : edges[now]) {
		if(e==from)continue;
		else {
			auto k=dfs(edges,e,now);

			int put_reward=k.first;
			int not_reward=0;
			if (k.second >= K) {
				not_reward=1;
				if (put_reward != 0) {
					flag=true;
				}
				put_reward=1;
				ch_big_num++;
			}
			else {
				flag=true;
			}
			ch_num+=k.second;
			put_reward=max(put_reward,k.first);

			if (put_reward >= 1) {
				sum++;
				v.push_back(put_reward);

				sort(v.begin(), v.end(), greater<int>());
				if (v.size() == 3)v.pop_back();
			}
		}
	}
	
	int nans=sum;
	if(!flag)nans--;
	if(v[0]>=1)nans+=v[0]-1;
	if(v[1]>=1)nans+=v[1]-1;
	if (ch_num <= N - K) {
		ans=max(ans,nans+1);
	}
	else {
		ans=max(ans,nans);
	}
	int kans=sum;
	if(v[0]>=1)kans+=v[0]-1;
	kans=max(kans,ch_big_num);
	return make_pair(kans,ch_num);
}

int main() {cin>>N>>K;
	vector<vector<int>>edges(N);
	for (int i = 1; i < N; ++i) {
		int a,b;cin>>a>>b;a--;b--;
		edges[a].push_back(b);
		edges[b].push_back(a);
	}
	dfs(edges,0,-1);
	cout<<ans<<endl;
	return 0;
}