#include <bits/stdc++.h>
using namespace std;
long long n, m, k;
long long getam(long long d, long long mx) {
  long long s = 0;
  long long rd = d;
  s += rd;
  rd = min(rd, mx - 1);
  long long ps = max(mx - 1, 0LL) + max(mx - rd, 0LL);
  s += (rd / 2.0) * (ps);
  return s;
}
bool can(int p) {
  long long s = 0;
  s += p;
  long long mind = min(k - 1, n - k);
  long long maxd = max(k - 1, n - k);
  s += getam(mind, p - 1);
  s += getam(maxd, p - 1);
  return s <= m;
}
int main() {
  cin >> n >> m >> k;
  long long l = 0;
  long long r = m;
  long long _m;
  while (l < r) {
    _m = (l + r) / 2;
    if (can(_m)) {
      l = _m + 1;
    } else {
      r = _m;
    }
  }
  if (can(r)) {
    l = r + 1;
  }
  cout << l - 1 << endl;
}
