#include <bits/stdc++.h>
using namespace std;
vector<int> link[110000];
int d[110000];
void init() {
  for (int i = 0; i <= 100000; i++) link[i].clear();
}
void addEdge(int a, int b) { link[a].push_back(b); }
void dfs(int x, int fa, int dep) {
  d[x] = dep;
  int len = link[x].size();
  for (int i = 0; i < len; i++)
    if (link[x][i] != fa) {
      dfs(link[x][i], x, dep + 1);
    }
}
int m, k, p, a, b;
int main() {
  scanf("%d%d%d", &m, &k, &p);
  k = min(m, k);
  for (int i = 1; i < m; i++) {
    scanf("%d%d", &a, &b);
    addEdge(a, b);
    addEdge(b, a);
  }
  memset(d, 0, sizeof d);
  dfs(1, -1, 0);
  sort(d + 1, d + m + 1);
  int f = 2;
  int ans = 0;
  for (int i = 3; i <= m; i++) {
    if (d[i] != d[i - 1]) p -= i - f;
    while (p < 0) p += d[i] - d[f++];
    ans = max(ans, i - f + 1);
  }
  printf("%d\n", min(ans, k));
}
