#include <bits/stdc++.h>
using namespace std;
int ind[500010], last[1000100 * 2], e[1000100 * 2], t;
void adde(int a, int b) {
  t++;
  e[t] = b;
  last[t] = ind[a];
  ind[a] = t;
}
int i, j, n, m, k;
int p[500010], pt;
void dfs(int a, int fa, int de) {
  int i;
  if (fa) {
    p[pt++] = de;
  }
  for (i = ind[a]; i; i = last[i]) {
    if (e[i] != fa) {
      dfs(e[i], a, de + 1);
    }
  }
}
int main() {
  scanf("%d %d %d", &n, &k, &m);
  int a, b;
  for (int cnt = n - 1; cnt; cnt--) {
    scanf("%d %d", &a, &b);
    adde(a, b);
    adde(b, a);
  }
  dfs(1, 0, 0);
  sort(p, p + pt);
  int ans = 0;
  long long int sum = 0, num = 0;
  j = 0;
  for (i = 0; i < pt; i++) {
    if (i && p[i] > p[i - 1]) {
      sum += num;
    }
    num++;
    while (j < i && sum > m) {
      sum -= p[i] - p[j];
      j++;
      num--;
    }
    if (num > k) {
      ans = k;
    } else if (num > ans)
      ans = num;
  }
  printf("%d\n", ans);
  return 0;
}
