#include <bits/stdc++.h>
using namespace std;
vector<int> g[(1 << 17)];
long long f[(1 << 17)], sum[(1 << 17)];
void dfs(int x, int fa, int d) {
  f[d]++;
  for (int i = 0; i < g[x].size(); i++)
    if (g[x][i] != fa) dfs(g[x][i], x, d + 1);
}
int main() {
  int n, k, p, u, v;
  cin >> n >> k >> p;
  for (int i = 1; i < n; i++)
    scanf("%d%d", &u, &v), g[u].push_back(v), g[v].push_back(u);
  dfs(1, 1, 0);
  for (int i = n; i >= 1; i--) sum[i] = sum[i + 1] + f[i];
  long long cur = 0;
  int cnt = 0, res = 0;
  for (int i = n, j = n - 1; i >= 1; i--) {
    cur -= sum[j + 1] - sum[i + 1], cnt -= f[i + 1];
    for (; j >= 1 && f[j] * (i - j) + cur <= p; j--)
      cur += f[j] * (i - j), cnt += f[j];
    if (j >= 1)
      res = max(res, int(cnt + (p - cur) / (i - j)));
    else
      res = max(res, cnt);
  }
  cout << min(res, k) << endl;
  return 0;
}
