#include <bits/stdc++.h>
using namespace std;
long long n, m, k;
long long tongji(long long pos, long long mid) {
  long long tmp = pos;
  if (tmp > mid) tmp = mid;
  pos -= tmp;
  return pos + tmp * (2 * mid - tmp + 1) / 2;
}
bool judge(long long mid) {
  long long tot = tongji(k, mid) + tongji(n - k + 1, mid) - mid;
  if (tot <= m) {
    return true;
  } else
    return false;
}
int main() {
  scanf("%I64d %I64d %I64d", &n, &m, &k);
  long long l = 1, r = m;
  long long ans;
  while (l <= r) {
    long long mid = (l + r) >> 1;
    if (judge(mid)) {
      ans = mid;
      l = mid + 1;
    } else {
      r = mid - 1;
    }
  }
  printf("%I64d\n", ans);
  return 0;
}
