#include <bits/stdc++.h>
using namespace std;
long long S[100005];
int N, K, P, D, Ans, A[100005], st[100005];
struct Lin {
  int v, next;
} E[100005 * 2];
void Link(int u, int v) {
  E[++D] = (Lin){v, st[u]};
  st[u] = D;
  E[++D] = (Lin){u, st[v]};
  st[v] = D;
}
void DFS(int u, int f) {
  for (int i = st[u], v; i; i = E[i].next)
    if ((v = E[i].v) ^ f) A[v] = A[u] + 1, DFS(v, u);
}
int main() {
  scanf("%d%d%d", &N, &K, &P);
  for (int i = 1, u, v; i < N; i++) scanf("%d%d", &u, &v), Link(u, v);
  DFS(1, 0);
  sort(A + 1, A + N + 1);
  for (int i = 1; i <= N; i++) S[i] = S[i - 1] + A[i];
  for (int Tim = 1, l = 1, r = 1; Tim <= N; Tim++) {
    for (; r + 1 <= N && A[r + 1] <= Tim; r++)
      ;
    for (; r - l > K || 1ll * Tim * (r - l) - (S[r] - S[l]) > P; l++)
      ;
    Ans = max(Ans, r - l);
  }
  printf("%d\n", Ans);
}
