#include <bits/stdc++.h>
using namespace std;
int head[100010], nxt[100010 << 1], to[100010 << 1], tot = 0;
void add(int x, int y) {
  to[++tot] = y;
  nxt[tot] = head[x];
  head[x] = tot;
}
int fa[100010], dep[100010];
int cnt[100010];
void dfs1(int x, int f) {
  fa[x] = f;
  dep[x] = dep[f] + 1;
  cnt[dep[x]]++;
  for (int i = head[x]; i; i = nxt[i]) {
    if (to[i] == f) continue;
    dfs1(to[i], x);
  }
}
int n, k, p;
int main() {
  scanf("%d%d%d", &n, &k, &p);
  for (int i = 1; i < n; i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    add(x, y);
    add(y, x);
  }
  dfs1(1, 0);
  sort(dep + 1, dep + 1 + n);
  int l = 2, r = 2, ans = 1, cost = 0;
  while (l < n && r < n) {
    r++;
    if (dep[r] != dep[r - 1]) cost += r - l;
    while (cost > p || r - l + 1 > k) {
      cost -= dep[r] - dep[l];
      l++;
    }
    ans = max(ans, r - l + 1);
  }
  printf("%d", ans);
  return 0;
}
