#include <bits/stdc++.h>
using namespace std;
int n, k, p, ans, head, tail, que[200000], vis[200000], dep[200000];
long long sum[200000];
vector<int> G[200000];
bool check(int x) {
  long long tmp = p + 1;
  for (int i = x + 1; i <= n; i++) {
    tmp = min(tmp, (long long)x * dep[que[i]] - (sum[i] - sum[i - x]));
  }
  return tmp <= p;
}
int main() {
  scanf("%d%d%d", &n, &k, &p);
  for (int i = 1, u, v; i < n; i++) {
    scanf("%d%d", &u, &v);
    G[u].push_back(v);
    G[v].push_back(u);
  }
  que[head = tail = 1] = vis[1] = 1;
  for (; head <= tail; head++) {
    int u = que[head];
    for (int i = G[u].size() - 1; i >= 0; i--) {
      int v = G[u][i];
      if (!vis[v]) vis[v] = 1, que[++tail] = v, dep[v] = dep[u] + 1;
    }
  }
  for (int i = 1; i <= n; i++) sum[i] = sum[i - 1] + dep[que[i]];
  int l = ans = 0, r = min(n - 1, k);
  while (l <= r) {
    int mid = (l + r) / 2;
    if (check(mid))
      ans = max(ans, mid), l = mid + 1;
    else
      r = mid - 1;
  }
  printf("%d\n", ans);
}
