#include <bits/stdc++.h>
using namespace std;
const long long N = 1000005;
const long long inf = 1e9;
const long long Inf = 1e10;
const long long P = 1000000007;
int Pow(int x, int y, int p) {
  int a = 1;
  for (; y; y >>= 1, x = (long long)x * x % p)
    if (y & 1) a = (long long)a * x % p;
  return a;
}
int n, K, V, fa[N], D[N];
vector<int> e[N];
long long S[N];
void DFS(int x) {
  for (long long i = (long long)(0); i < (long long)(e[x].size()); i++) {
    int v = e[x][i];
    if (v == fa[x]) continue;
    fa[v] = x;
    D[v] = D[x] + 1;
    DFS(v);
  }
}
int main() {
  scanf("%d%d%d", &n, &K, &V);
  for (long long i = (long long)(1); i <= (long long)(n - 1); i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    e[x].push_back(y);
    e[y].push_back(x);
  }
  DFS(1);
  sort(D + 1, D + n + 1);
  for (long long i = (long long)(1); i <= (long long)(n); i++)
    S[i] = S[i - 1] + D[i];
  int Ans = 0;
  for (int i = 1, l = 1, r = 2; i <= n; i++) {
    for (; r + 1 <= n && D[r + 1] <= i; r++)
      ;
    for (; r - l > K || 1ll * D[r] * (r - l) - (S[r] - S[l]) > V; l++)
      ;
    Ans = max(Ans, r - l);
  }
  printf("%d\n", Ans);
  return 0;
}
