#include <bits/stdc++.h>
using namespace std;
int m, k, p;
vector<int> ke[100111];
int depth[100111];
long long sumDepth[100111];
int ans;
void visit(int u, int pre) {
  int sizeu = ke[u].size();
  for (int i = 0; i <= sizeu - 1; i++) {
    int v = ke[u][i];
    if (v == pre) continue;
    depth[v] = depth[u] + 1;
    visit(v, u);
  }
}
void readInput() {
  scanf("%d%d%d", &m, &k, &p);
  for (int i = 1; i <= m - 1; i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    ke[u].push_back(v);
    ke[v].push_back(u);
  }
}
void init() { ans = 1; }
void cal(int cs) {
  int low = cs;
  int hight = m;
  int res = cs;
  while (low < hight) {
    int mid = (low + hight + 1) / 2;
    int sl = mid - cs + 1;
    long long value1 = (long long)sl * depth[cs];
    long long value2 = sumDepth[mid] - sumDepth[cs - 1];
    if (value1 - value2 <= (long long)p) {
      low = mid;
      res = mid;
    } else {
      hight = mid - 1;
    }
  }
  ans = max(ans, min(k, res - cs + 1));
}
void calSumDepth() {
  for (int i = 2; i <= m; i++)
    sumDepth[i] = sumDepth[i - 1] + (long long)depth[i];
}
void solve() {
  visit(1, 0);
  sort(depth + 2, depth + m + 1, greater<int>());
  calSumDepth();
  for (int i = 2; i <= m; i++) cal(i);
}
void writeOutput() { printf("%d\n", ans); }
int main() {
  if (0 == 1) {
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
  }
  readInput();
  init();
  solve();
  writeOutput();
  return 0;
}
