#include <bits/stdc++.h>
using namespace std;
long long m, k, p, a, b, ans, cx, md;
long long dep[100001];
bool been[100001];
vector<vector<long long> > grap;
vector<long long> v;
queue<long long> q;
void rot(long long x, long long d) {
  md = max(md, d);
  been[x] = true;
  dep[d]++;
  for (long long i = 0; i < grap[x].size(); i++)
    if (!been[grap[x][i]]) rot(grap[x][i], d + 1);
}
int main() {
  ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  cin >> m >> k >> p;
  for (long long i = 0; i < m; i++) grap.push_back(v);
  for (long long i = 0; i < m - 1; i++)
    cin >> a >> b, grap[a - 1].push_back(b - 1), grap[b - 1].push_back(a - 1);
  rot(0, 0);
  for (long long i = 1; i <= md; i++) {
    cx += q.size();
    for (long long j = 0; j < dep[i]; j++) q.push(i);
    while (q.size()) {
      if (cx <= p and q.size() <= k) break;
      cx -= (i - q.front());
      q.pop();
    }
    ans = max(ans, (long long)q.size());
  }
  cout << ans;
}
