#include <bits/stdc++.h>
using namespace std;
long long int n, m, k;
long long int st, dr;
long long int maxim;
long long int mij;
long long int calc(long long int pillows, int dist) {
  if (dist >= pillows - 1) {
    return pillows * (pillows - 1) / 2 + dist - (pillows - 1);
  } else {
    return (2 * pillows - 1 - dist) * dist / 2;
  }
}
bool ok(long long int pillows) {
  int ds = (k - 1);
  int dd = (n - k);
  long long int total = (calc(pillows, ds) + calc(pillows, dd));
  return (total + pillows) <= m;
}
int main() {
  scanf("%lld %lld %lld", &n, &m, &k);
  st = 1, dr = m;
  while (st <= dr) {
    mij = (st + dr) / 2;
    if (ok(mij)) {
      st = mij + 1;
      maxim = maxim > mij ? maxim : mij;
    } else {
      dr = mij - 1;
    }
  }
  printf("%lld\n", maxim);
  return 0;
}
