#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10;
int n, k, p;
vector<int> adj[maxn];
int h[maxn];
int total[maxn];
int hmax;
void dfs(int v, int par) {
  ++total[h[v]];
  hmax = max(hmax, h[v]);
  for (auto u : adj[v])
    if (u != par) {
      h[u] = h[v] + 1;
      dfs(u, v);
    }
}
int used[maxn];
bool ok(int x) {
  int pointer = 2;
  int cnt = 0;
  long long cost = 0;
  for (int depht = 2; depht <= hmax; ++depht) used[depht] = 0;
  for (int depht = 2; depht <= hmax; ++depht) {
    cost += cnt;
    cnt += total[depht];
    used[depht] = total[depht];
    while (cost > p) {
      if (!used[pointer]) ++pointer;
      cost -= (depht - pointer);
      --used[pointer];
      --cnt;
    }
    if (cost <= p && cnt >= x) return true;
  }
  return false;
}
int bs() {
  int L = 1;
  int R = min(k, n - 1);
  while (L < R) {
    int mid = (L + R + 1) >> 1;
    if (ok(mid))
      L = mid;
    else
      R = mid - 1;
  }
  return R;
}
int solve() {
  if (!k) return 0;
  h[1] = 1;
  dfs(1, -1);
  return bs();
}
int main() {
  cin.sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> k >> p;
  for (int i = 1; i <= n - 1; ++i) {
    int u, v;
    cin >> u >> v;
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  cout << solve() << '\n';
  return 0;
}
