#include <bits/stdc++.h>
using namespace std;
const long long N = 1e5 + 100;
long long h[N];
vector<long long> a[N];
void dfs(long long v, long long p = -1) {
  for (auto u : a[v]) {
    if (u != p) {
      h[u] = h[v] + 1;
      dfs(u, v);
    }
  }
}
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  long long n, k, p;
  cin >> n >> k >> p;
  for (long long i = 0, u, v; i < n - 1; i++) {
    cin >> u >> v;
    u--;
    v--;
    a[u].push_back(v);
    a[v].push_back(u);
  }
  dfs(0);
  sort(h, h + n, greater<long long>());
  n--;
  long long l = 0, r = 0;
  while (h[r] == h[l]) r++;
  long long sum = 0;
  long long maxi = 0;
  while (l < n) {
    while (r < n && sum + h[l] - h[r] <= p) {
      sum += h[l] - h[r];
      r++;
    }
    maxi = max(maxi, r - l);
    long long l2 = l;
    while (l2 < n && h[l2] == h[l]) l2++;
    if (l2 < n) {
      sum -= (r - l2) * (h[l] - h[l2]);
    }
    l = l2;
  }
  cout << min(maxi, k) << "\n";
  return 0;
}
