#include <bits/stdc++.h>
using namespace std;
struct edge {
  int to, nxt;
} e[2000005];
int n, k, head[1000005], cnt = 1, ans, deg[1000005];
inline void addedge(int from, int to) {
  e[cnt].to = to;
  e[cnt].nxt = head[from];
  head[from] = cnt++;
}
int dfs(int u, int fa) {
  vector<int> v;
  for (int i = head[u]; i; i = e[i].nxt) {
    if (e[i].to == fa) continue;
    v.push_back(dfs(e[i].to, u) + 1);
  }
  if (!v.size()) return 0;
  sort(v.begin(), v.end());
  for (int i = v.size() - 1; i >= 1; i--) {
    if (v[i] + v[i - 1] > k) {
      ans++;
    } else {
      return v[i];
    }
  }
  return v[0];
}
int main() {
  scanf("%d%d", &n, &k);
  for (int i = 1; i < n; i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    deg[x]++, deg[y]++;
    addedge(x, y);
    addedge(y, x);
  }
  for (int i = 1; i <= n; i++) {
    if (deg[i] > 1) {
      dfs(i, 0);
      break;
    }
  }
  printf("%d\n", ans + 1);
  return 0;
}
