#include <iostream>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <queue>
#include <deque>
#include <set>
#include <sstream>
#include <utility>
#include <list>
#include <ctime>
#include <memory>

using namespace std;

int n,k,a,b,dia,ans=999999999;
vector<int> tree[2005];
vector<int> kill;
int depth[2005];

int dfs(int k,int d){
	int s=1;
	if(d<dia){
		for(int i=0;i<tree[k].size();i++){
			s+=dfs(tree[k][i],d+1);
		}
	}
	return s;
}

int main()
{
	cin >>n>>k;
	for(int i=0;i<n-1;i++){
		cin >>a>>b;
		tree[a].push_back(b);
		tree[b].push_back(a);
	}
	
	dia=(k+1)/2;
	
	for(int i=1;i<=n;i++){
		if(tree[i].size()>1){
			ans=min(ans,n-dfs(i,0));
		}
	}

	if(ans<=0){
		cout << "0";
		return 0;
	}
	
	cout << ans;
	
	return 0;
}