#include <bits/stdc++.h>
using namespace std;
const long long mod = 998244353;
const int maxn = 1e6 + 10;
vector<int> e[maxn];
int n, k, ans;
int dfs(int u, int fa) {
  int sz = e[u].size();
  if (sz == 1) return 0;
  int i, c = 0;
  vector<int> dep;
  for (i = 0; i < sz; i++) {
    int v = e[u][i];
    if (v == fa) continue;
    dep.push_back(dfs(v, u) + 1);
  }
  sort(dep.begin(), dep.end());
  for (i = dep.size() - 1; i; i--) {
    if (dep[i] + dep[i - 1] > k)
      ans++;
    else
      break;
  }
  return dep[i];
}
int main() {
  scanf("%d%d", &n, &k);
  for (int u, v, i = 1; i < n; i++) {
    scanf("%d%d", &u, &v);
    e[u].push_back(v);
    e[v].push_back(u);
  }
  for (int i = 1; i <= n; i++)
    if (e[i].size() > 1) {
      dfs(i, 0);
      break;
    }
  printf("%d\n", ans + 1);
  return 0;
}
