#include <bits/stdc++.h>
using namespace std;
const long long MAXN = 1e5 + 5;
long long n, k, p;
long long head[MAXN], to[MAXN << 1], nxt[MAXN << 1], cnt;
void add(long long u, long long v) {
  nxt[++cnt] = head[u];
  head[u] = cnt;
  to[cnt] = v;
}
long long dep[MAXN], c[MAXN];
void dfs(long long x, long long fa) {
  dep[x] = dep[fa] + 1;
  for (long long i = head[x]; i; i = nxt[i]) {
    if (to[i] == fa) continue;
    dfs(to[i], x);
  }
}
bool cmp(long long x, long long y) { return dep[x] < dep[y]; }
long long _sum[MAXN];
signed main() {
  scanf("%lld %lld %lld", &n, &k, &p);
  for (long long i = 1; i < n; ++i) {
    long long u, v;
    scanf("%lld %lld", &u, &v);
    add(u, v);
    add(v, u);
    c[i] = i;
  }
  c[n] = n;
  dfs(1, 0);
  sort(c + 1, c + 1 + n, cmp);
  for (long long i = 1; i <= n; ++i) _sum[i] = _sum[i - 1] + dep[c[i]];
  long long r = 2, ans = 0;
  for (long long l = 2; l <= n; ++l) {
    while ((r + 2 - l) * dep[c[r + 1]] - (_sum[r + 1] - _sum[l - 1]) <= p &&
           r + 1 <= n)
      r++;
    ans = max(ans, r + 1 - l);
  }
  printf("%lld", min(ans, k));
  return 0;
}
