#include <bits/stdc++.h>
using namespace std;
vector<int> e[100000];
int d[100000];
int s[100000];
void dfs(int v, int p, int dep) {
  d[dep]++;
  for (int i = 0; i < e[v].size(); i++) {
    int u = e[v][i];
    if (u == p) continue;
    dfs(u, v, dep + 1);
  }
}
long long min(long long a, long long b) { return a < b ? a : b; }
long long solve(int k, int m) {
  for (int i = 0; i < m; i++) s[i] = 0;
  long long l = m - 1, r = m - 1;
  long long c = 0;
  int rm = k;
  while (r > 0 && rm > 0) {
    if (s[r] + rm < d[r]) {
      c += (l - r) * rm;
      s[r] += rm;
      rm = 0;
    } else {
      c += (l - r) * (d[r] - s[r]);
      rm -= d[r] - s[r];
      s[r] = d[r];
      r--;
    }
  }
  long long ans = c;
  while (1) {
    rm = s[l];
    c -= k - s[l];
    if (r == l) r--;
    l--;
    while (r > 0 && rm > 0) {
      if (s[r] + rm < d[r]) {
        s[r] += rm;
        c += (l - r) * rm;
        rm = 0;
      } else {
        c += (l - r) * (d[r] - s[r]);
        rm -= d[r] - s[r];
        s[r] = d[r];
        r--;
      }
    }
    if (rm == 0) ans = min(ans, c);
    if (r == 0) return ans;
  }
}
int main() {
  int n, k, m;
  scanf("%d %d %d", &n, &k, &m);
  int i;
  for (i = 0; i < n - 1; i++) {
    int a, b;
    scanf("%d %d", &a, &b);
    a--;
    b--;
    e[a].push_back(b);
    e[b].push_back(a);
  }
  for (i = 0; i < n; i++) d[i] = 0;
  dfs(0, -1, 0);
  int M = 0;
  while (M < n && d[M] > 0) M++;
  int l = 0, r = min(n, k + 1);
  while (r - l > 1) {
    int mid = (l + r) / 2;
    if (solve(mid, M) <= m)
      l = mid;
    else
      r = mid;
  }
  printf("%d\n", l);
  return 0;
}
