#include <bits/stdc++.h>
using namespace std;
void qmax(int &x, int y) {
  if (x < y) x = y;
}
void qmin(int &x, int y) {
  if (x > y) x = y;
}
inline int read() {
  char s;
  int k = 0, base = 1;
  while ((s = getchar()) != '-' && s != EOF && !(isdigit(s)))
    ;
  if (s == EOF) exit(0);
  if (s == '-') base = -1, s = getchar();
  while (isdigit(s)) k = k * 10 + (s ^ '0'), s = getchar();
  return k * base;
}
inline void write(int x) {
  static char cnt, num[15];
  cnt = 0;
  if (!x) {
    putchar('0');
    return;
  }
  for (; x; x /= 10) num[++cnt] = x % 10;
  for (; cnt; putchar(num[cnt--] + 48))
    ;
}
const int maxn = 2e5 + 100;
int n, X, Y, h[maxn], ans, j;
long long cost, k, p;
int po[maxn], to[maxn << 1], ne[maxn << 1], id;
void add(int x, int y) {
  id++;
  to[id] = y, ne[id] = po[x], po[x] = id;
}
void dfs(int x, int fa) {
  h[x] = h[fa] + 1;
  for (int i = po[x]; i; i = ne[i])
    if (to[i] != fa) dfs(to[i], x);
}
int main() {
  n = read();
  k = read();
  p = read();
  for (int i = 1; i < n; i++) {
    X = read();
    Y = read();
    add(X, Y);
    add(Y, X);
  }
  dfs(1, 0);
  sort(h + 1, h + n + 1);
  int i = 2;
  j = 2;
  ans = 1;
  while (i < n && j < n) {
    j++;
    if (h[j] != h[j - 1]) cost += j - i;
    while (cost > p) {
      cost -= h[j] - h[i];
      i++;
    }
    qmax(ans, j - i + 1);
  }
  ans = min(ans, (int)k);
  printf("%d\n", ans);
  return 0;
}
