#include <bits/stdc++.h>
using namespace std;
template <class T>
T sqr(T x) {
  return x * x;
}
long long d[110000], sum[110000];
int v[110000];
vector<int> a[110000];
void dfs(int x, int dep) {
  int i, y;
  d[x] = dep;
  v[x] = 1;
  for (i = 0; i < a[x].size(); i++) {
    y = a[x][i];
    if (!v[y]) dfs(y, dep + 1);
  }
}
int main() {
  int n, m, p, x, y, ans, i, l, r, mid;
  scanf("%d%d%d", &n, &m, &p);
  for (i = 1; i < n; i++) {
    scanf("%d%d", &x, &y);
    a[x].push_back(y);
    a[y].push_back(x);
  }
  dfs(1, 1);
  sort(d + 1, d + n + 1);
  partial_sum(d, d + n + 1, sum);
  ans = 0;
  for (i = 2; i <= n; i++) {
    l = 2;
    r = i;
    while (l <= r) {
      mid = (l + r) / 2;
      if (d[i] * (i - mid + 1) - (sum[i] - sum[mid - 1]) <= p)
        r = mid - 1;
      else
        l = mid + 1;
    }
    ans = max(ans, i - r);
  }
  ans = min(ans, m);
  printf("%d\n", ans);
}
