#include <bits/stdc++.h>
using namespace std;
vector<int> adj[100005];
int n, k, p;
int cnt[100005];
int sum[100005];
int d_max;
void dfs(int u, int d, int p) {
  cnt[d]++, d_max = max(d_max, d);
  for (int i = 0; i < adj[u].size(); ++i) {
    int v = adj[u][i];
    if (v == p) continue;
    dfs(v, d + 1, u);
  }
}
int dq[100005];
int head, tail;
int t[100005];
int main() {
  scanf("%d%d%d", &n, &k, &p);
  for (int i = 0; i < n - 1; ++i) {
    int u, v;
    scanf("%d%d", &u, &v), u--, v--;
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  dfs(0, 1, -1);
  cnt[1]--;
  for (int i = 1; i <= d_max; ++i) sum[i] = sum[i - 1] + cnt[i];
  int s = 0, e = min(n - 1, k);
  int ans = 0;
  while (s <= e) {
    head = 0, tail = 0;
    int mid = (s + e) / 2;
    long long cost = 1ll << 60;
    long long tot = 0;
    int m = mid, iidx;
    for (int i = 1; i <= d_max; ++i)
      if (sum[i] >= m) {
        tail += i, iidx = i;
        long long mul = 0;
        for (int j = i; j >= 1; --j) {
          dq[j - 1] = j;
          t[j - 1] = min(cnt[j], m);
          tot += mul * t[j - 1];
          m = max(0, m - cnt[j]), mul++;
        }
        break;
      }
    cost = tot;
    for (int i = iidx + 1; i <= d_max; ++i) {
      int tmp = cnt[i];
      while (head < tail && tmp > t[head]) {
        int sub = t[head];
        tot -= (long long)(i - dq[head] - 1) * sub;
        tmp -= sub;
        head++;
      }
      if (tmp > 0 && head < tail) {
        tot -= (long long)(i - dq[head] - 1) * tmp;
        t[head] -= tmp;
      }
      tot += (mid - min(mid, cnt[i]));
      cost = min(cost, tot);
      dq[tail] = i;
      t[tail] = min(mid, cnt[i]);
      tail++;
    }
    if (cost <= p)
      ans = mid, s = mid + 1;
    else
      e = mid - 1;
  }
  printf("%d", ans);
}
