#include <bits/stdc++.h>
using namespace std;
int n, k, p;
int x[210000];
int y[210000];
int next_[210000];
int pr[210000];
int a[210000];
void go(int v, int p, int lvl) {
  a[v] = lvl;
  for (int i = pr[v]; i; i = next_[i]) {
    if (y[i] != p) go(y[i], v, lvl + 1);
  }
}
int main() {
  cin >> n >> k >> p;
  for (int i = 1; i < n; i++) {
    scanf("%d%d", &x[i], &y[i]);
    x[i + n - 1] = y[i];
    y[i + n - 1] = x[i];
  }
  for (int i = 1; i <= n + n - 2; i++) {
    next_[i] = pr[x[i]];
    pr[x[i]] = i;
  }
  go(1, 0, 0);
  sort(a + 1, a + n + 1);
  int ans = 0;
  int rr = 2;
  long long sum = 0;
  long long C = 0;
  for (int i = 2; i <= n; i++) {
    C++;
    sum += a[i];
    while (C * a[i] - sum > p) {
      sum -= a[rr];
      C--;
      rr++;
    }
    ans = max(ans, (int)(C));
  }
  ans = min(ans, k);
  cout << ans << endl;
  return 0;
}
