import java.io.*;
import java.util.*;

public class cockroach_ak_exp {
	int n, c;

	ArrayList<Integer>[] g;
	boolean[] used;
	
	int[] used2;
	int iteration = 1;
	
	void dfs(int v, int remain) {
		used2[v] = iteration;
		used[v] = true;
		if (remain == 0)
			return;
		for (int to : g[v]) {
			if (used2[to] != iteration) 
				dfs(to, remain - 1);
		}
	}
	
	boolean check(int mask) {
		Arrays.fill(used, false);
		int cnt = 0;
		for (int i = 0; i < n; i++) {
			if (((mask >> i) & 1) == 1) {
				cnt++;
				iteration++;
				dfs(i, c);
			}
		}
		boolean ok = true;
		for (int i = 0; i < n; i++) {
			ok &= used[i];
		}
		return ok;
	}
	
	@SuppressWarnings("unchecked")
	void run() throws FileNotFoundException {
		Scanner in = new Scanner(new File("cockroach.in"));
		PrintWriter out = new PrintWriter("cockroach.out");
		n = in.nextInt();
		c = in.nextInt();
		g = new ArrayList[n];
		for (int i = 0; i < n; i++) {
			g[i] = new ArrayList<Integer>();
		}
		for (int i = 0; i < n - 1; i++) {
			int f = in.nextInt() - 1;
			int t = in.nextInt() - 1;
			g[f].add(t);
			g[t].add(f);
		}
		
		used = new boolean[n];
		used2 = new int[n];
		int ans = n;
		for (int mask = 0; mask < (2 << (n - 1)); mask++) {
			int cnt = Integer.bitCount(mask);
			if (ans > cnt && check(mask)) {
				ans = cnt;
			}
		}
		out.println(ans);
		out.close();
	}
	
	public static void main(String[] args) throws FileNotFoundException {
		new cockroach_ak_exp().run();
	}
}
