#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef pair<int, int> ii; 

const int N = 2010; 
vector<int> adj[N];
int n, k, dist[N]; 

int dfs(int u, int par) {
    for(int v : adj[u]) if(v - par) {
        dist[v] = dist[u] + 1; 
        dfs(v, u); 
    }
}

int main(int argc, char const *argv[]) {
    scanf("%d %d", &n, &k); 
    for(int i = 1; i < n; i++) {
        int u, v; scanf("%d %d", &u, &v); 
        adj[u].push_back(v);
        adj[v].push_back(u); 
    }
    int ans = 1e9; 
    int r = (k + 1) / 2; 
    for(int i = 1; i <= n; i++) {
        dist[i] = 0; 
        dfs(i, 0); 
        int cnt = 0; 
        for(int j = 1; j <= n; j++) 
            if(dist[j] > r) cnt++;
        ans = min(ans, cnt); 
    }
    printf("%d\n", ans); 
}
