#include <bits/stdc++.h>
using namespace std;
const long long int N = 100009;
long long int p;
vector<long long int> v[N];
long long int dep[N];
long long int lst;
void fillpre(long long int q, long long int p, long long int d) {
  dep[d]++;
  for (auto i : v[q]) {
    if (i != p) {
      fillpre(i, q, d + 1);
    }
  }
  lst = max(lst, d);
}
bool check(long long int x) {
  long long int the_pos = lst;
  long long int pos = lst, left = dep[pos], cnt = x, mul = 0, cost = 0;
  while (pos > 0 && the_pos > 0) {
    if (cnt != 0) {
      long long int y = min(left, cnt);
      cost += (y * mul);
      cnt -= y;
      left -= y;
      if (left == 0) {
        pos--;
        left = dep[pos];
        mul++;
      }
    }
    if (cnt == 0) {
      if (cost <= p) return 1;
      cost -= (x - dep[the_pos]);
      cnt += dep[the_pos];
      the_pos--;
      mul--;
    }
  }
  return 0;
}
void solve() {
  long long int n, k;
  cin >> n >> k >> p;
  long long int x, y;
  for (long long int i = 1; i < n; i++) {
    cin >> x >> y;
    v[x].push_back(y);
    v[y].push_back(x);
  }
  fillpre(1, 0, 0);
  long long int ans = 1;
  long long int l = 1, u = min(k, n - 1), mid;
  while (l <= u) {
    mid = (l + u) / 2;
    if (check(mid)) {
      ans = mid;
      l = mid + 1;
    } else
      u = mid - 1;
  }
  cout << ans << '\n';
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int begtime = clock();
  long long int t = 1;
  for (long long int i = 0; i < t; i++) {
    solve();
  }
  int endtime = clock();
  cerr << "\n\n"
       << "Time elapsed: " << (endtime - begtime) * 1000 / CLOCKS_PER_SEC
       << " ms\n\n";
  return 0;
}
