#include <bits/stdc++.h>
using namespace std;
int n, m, k, p;
vector<int> g[120000];
int depth[120000];
void dfs(int u, int father, int Depth) {
  depth[u] = Depth;
  for (int i = 0; i < g[u].size(); ++i)
    if (g[u][i] != father) dfs(g[u][i], u, Depth + 1);
}
int main() {
  cin >> n >> k >> p;
  for (int i = (1); i <= (n); ++i) g[i].clear();
  int x, y;
  for (int i = (1); i <= (n - 1); ++i) {
    scanf("%d%d", &x, &y);
    g[x].push_back(y);
    g[y].push_back(x);
  }
  dfs(1, 0, 0);
  sort(depth + 1, depth + 1 + n);
  int l = 2, ans = 1;
  for (int i = 3; i <= n; ++i) {
    if (depth[i] != depth[i - 1]) p -= i - l;
    while (p < 0) p += depth[i] - depth[l++];
    ans = max(ans, i - l + 1);
  }
  cout << min(ans, k) << endl;
  fclose(stdin);
  fclose(stdout);
  return 0;
}
