#include <bits/stdc++.h>
using namespace std;
long long n, k, m;
bool check(long long x) {
  long long ans = 0;
  if (x >= k) {
    ans += (2 * x - k + 1) * k / 2;
  } else {
    ans += (x + 1) * x / 2 + (k - x);
  }
  int k2 = (n - k) + 1;
  if (x >= k2) {
    ans += (2 * x - k2 + 1) * k2 / 2;
  } else {
    ans += (x + 1) * x / 2 + (k2 - x);
  }
  if (ans - x > m)
    return false;
  else
    return true;
}
int main() {
  long long st = 1, dr;
  cin >> n >> m >> k;
  dr = m;
  while (st <= dr) {
    long long mij = st + (dr - st) / 2;
    if (check(mij))
      st = mij + 1;
    else
      dr = mij - 1;
  }
  cout << st - 1;
  return 0;
}
