#include <bits/stdc++.h>
using namespace std;
const int MAXN = 200010;
struct Eg {
  int v;
  Eg *ne;
} e[MAXN], *po[MAXN], *G = e;
int N, K, P, ans, la, d[MAXN];
void add(int a, int b) {
  G->v = b;
  G->ne = po[a];
  po[a] = G++;
}
void dfs(int x, int f) {
  d[x] = d[f] + 1;
  for (Eg *j = po[x]; j; j = j->ne)
    if (j->v != f) dfs(j->v, x);
}
int main() {
  scanf("%d%d%d", &N, &K, &P);
  for (int i = 1, a, b; i < N; ++i) scanf("%d%d", &a, &b), add(a, b), add(b, a);
  dfs(1, 0);
  sort(d + 1, d + N + 1);
  la = 2;
  for (int i = 3; i <= N; ++i) {
    if (d[i] != d[i - 1]) P -= i - la;
    while (P < 0) P += d[i] - d[la++];
    ans = max(ans, i - la + 1);
  }
  printf("%d\n", min(ans, K));
}
