#include <bits/stdc++.h>
using namespace std;
int n, k, p, a, b, q, h, mid, i, n1[210000], hh[210000];
long long sumh[210000];
vector<int> ve[210000];
void bfs() {
  int q, h, i;
  for (n1[q = h = 1] = 1, hh[1] = 1; q <= h; q++)
    for (i = 0; i < (int)ve[n1[q]].size(); i++)
      if (!hh[ve[n1[q]][i]]) n1[++h] = ve[n1[q]][i], hh[n1[h]] = hh[n1[q]] + 1;
  for (i = 1; i <= n; i++) sumh[i] = sumh[i - 1] + hh[n1[i]];
}
bool can(int x) {
  long long sum = 1000000000000000000LL;
  for (int i = x + 1; i <= n; i++)
    sum = min(sum, 1LL * hh[n1[i]] * x - (sumh[i] - sumh[i - x]));
  return sum <= p;
}
int main() {
  scanf("%d%d%d", &n, &k, &p);
  for (i = 1; i < n; i++) {
    scanf("%d%d", &a, &b);
    ve[a].push_back(b);
    ve[b].push_back(a);
  }
  bfs();
  q = 0;
  h = min(n - 1, k) + 1;
  while (q < h - 1) {
    mid = (q + h) / 2;
    if (can(mid))
      q = mid;
    else
      h = mid;
  }
  printf("%d\n", q);
}
