#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
const int C = 26;
void add(int &x, int y) {
  x += y;
  while (x >= MOD) x -= MOD;
  while (x < 0) x += MOD;
}
int fix(int x) {
  while (x >= MOD) x -= MOD;
  while (x < 0) x += MOD;
  return x;
}
int pw(int a, int b) {
  int ret = 1;
  while (b) {
    if (b & 1) ret = 1ll * ret * a % MOD;
    b >>= 1;
    a = 1ll * a * a % MOD;
  }
  return ret;
}
const int MAXN = 1e5 + 10;
int n, k, coins;
vector<int> g[MAXN], lv[MAXN];
void dfs(int u = 1, int p = 0, int d = 0) {
  lv[d].push_back(u);
  for (int v : g[u]) {
    if (v ^ p) {
      dfs(v, u, d + 1);
    }
  }
}
long long pre[2][MAXN];
void solve() {
  cin >> n >> k >> coins;
  for (int i = 0; i < n - 1; i++) {
    int a, b;
    cin >> a >> b;
    g[a].push_back(b);
    g[b].push_back(a);
  }
  dfs();
  int ans = 0;
  for (int i = 1; i <= n; i++) {
    pre[0][i] = pre[0][i - 1] + (long long)i * lv[i].size();
    pre[1][i] = pre[1][i - 1] + lv[i].size();
  }
  for (int d = 1; !lv[d].empty(); d++) {
    int lo = 1, hi = d;
    while (lo < hi) {
      int mid = (lo + hi) / 2;
      long long cost = (long long)d * (pre[1][d] - pre[1][mid - 1]) -
                       (pre[0][d] - pre[0][mid - 1]);
      if (cost <= coins) {
        hi = mid;
      } else {
        lo = mid + 1;
      }
    }
    int have = pre[1][d] - pre[1][hi - 1];
    if (have >= k) {
      ans = k;
      break;
    }
    long long spent = (long long)d * (pre[1][d] - pre[1][hi - 1]) -
                      (pre[0][d] - pre[0][hi - 1]);
    long long rem = coins - spent;
    int nxt = hi - 1;
    if (nxt == 0) {
      ans = max(ans, have);
      continue;
    }
    lo = 0, hi = min((int)lv[nxt].size(), k - have);
    while (lo < hi) {
      int mid = (lo + hi + 1) / 2;
      long long cost = (long long)mid * (d - nxt);
      if (cost <= rem) {
        lo = mid;
      } else {
        hi = mid - 1;
      }
    }
    have += lo;
    ans = max(ans, have);
  }
  cout << ans << "\n";
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int te = 1;
  for (int w = 1; w <= te; w++) {
    solve();
  }
  return 0;
}
