#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + (ch ^ 48);
    ch = getchar();
  }
  return x * f;
}
const int N = 100010;
struct edge {
  int v, nxt;
} e[N << 1];
int head[N], cnt, n, k, p, x, y, dep[N], num[N], ans = 1, tot, l = 2, r = 2;
inline void add(int u, int v) {
  e[++cnt].v = v;
  e[cnt].nxt = head[u];
  head[u] = cnt;
}
inline void dfs(int u, int fa) {
  dep[u] = dep[fa] + 1;
  ++num[dep[u]];
  for (int i = head[u]; i; i = e[i].nxt) {
    int v = e[i].v;
    if (v == fa) continue;
    dfs(v, u);
  }
}
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(dep + 1, dep + n + 1);
  while (l < n && r < n) {
    ++r;
    if (dep[r] != dep[r - 1]) tot += r - l;
    while (tot > p || r - l + 1 > k) tot -= dep[r] - dep[l], ++l;
    ans = max(ans, r - l + 1);
  }
  printf("%d", ans);
  return 0;
}
