#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 113, inf = 1e9 + 113;
vector<int> edges[N];
int dist[N];
signed main() {
  cin.tie(NULL);
  ios_base::sync_with_stdio(false);
  int n, k, p;
  scanf("%d", &n);
  scanf("%d", &k);
  scanf("%d", &p);
  for (int i = 2; i <= n; i++) {
    dist[i] = inf;
    int u, v;
    scanf("%d", &u);
    scanf("%d", &v);
    edges[u].push_back(v);
    edges[v].push_back(u);
  }
  vector<int> order;
  queue<int> bfs;
  bfs.push(1);
  while (!bfs.empty()) {
    int v = bfs.front();
    order.push_back(dist[v]);
    bfs.pop();
    for (auto i : edges[v]) {
      if (dist[i] > dist[v] + 1) dist[i] = dist[v] + 1, bfs.push(i);
    }
  }
  long long ans = 0, j = 1, sum = 0;
  for (int i = 1; i < n; i++) {
    sum += -order[i];
    while (i - j + 1 > k || sum + ((long long)(i - j + 1)) * order[i] > p)
      j++, sum += order[j - 1];
    ans = max(ans, i - j + 1);
  }
  cout << ans << endl;
}
