#include <iostream>
#include <vector>
using namespace std;

int n,k,cnt;
vector<int> G[2000];

void dfs(int v,int par,int d){
	if(d > k / 2) cnt++;
	for(int to : G[v]){
		if(to == par) continue;
		dfs(to,v,d + 1);
	}
}

int main(){
	int a[2000],b[2000];
	cin >> n >> k;
	for(int i = 0;i < n - 1;i++){
		cin >> a[i] >> b[i]; a[i]--;b[i]--;
		G[a[i]].push_back(b[i]);
		G[b[i]].push_back(a[i]);
	}
	int mi = 3000;
	if(k % 2){
		for(int i = 0;i < n - 1;i++){
			cnt = 0;
			dfs(a[i],b[i],0);
			dfs(b[i],a[i],0);
			mi = min(mi,cnt);
		}
	}else{
		for(int i = 0;i < n;i++){
			cnt = 0;
			dfs(i,-1,0);
			mi = min(mi,cnt);
		}
	}
	cout << mi << endl;
	return 0;
}