#include <bits/stdc++.h>

using namespace std;

const int maxn = 2e3 + 23;

int n, dtr, rad, res;
vector<int> adj[maxn];
bool buf;

int dfs(int v, int par, int dist) {
	int ret = (dist < 0);
	for (auto u : adj[v]) {
		if (u != par)
			ret += dfs(u, v, dist-1);
	}
	return ret;
}

inline void solve() {
	res = n-1;
	for (int i = 1; !(dtr&1) and i <= n; i++) {
		res = min(res, dfs(i, -1, rad));
	}
	for (int i = 1; (dtr&1) and i <= n; i++) {
		for (auto u : adj[i]) {
			if (i < u)
				res = min(res, dfs(i, u, rad) + dfs(u, i, rad));
		}
	}
}

int main() {

	buf = scanf("%d %d", &n, &dtr);
	for (int i = 1; i <= n-1; i++) {
		int x, y;
		buf = scanf("%d %d", &x, &y);

		adj[x].emplace_back(y);
		adj[y].emplace_back(x);
	}

	rad = dtr>>1;

	solve();

	printf("%d\n", res);

	return 0;
}