#include <bits/stdc++.h>
using namespace std;
long long n, p, k, leftt, rightt;
long long check(long long m) {
  long long tot = m, curr = m - 1;
  if (curr <= leftt) {
    tot += (curr * (curr + 1)) / 2 + (leftt - curr);
  } else {
    tot +=
        ((curr * (curr + 1)) / 2 - ((curr - leftt) * (curr - leftt + 1)) / 2);
  }
  if (curr <= rightt) {
    tot += (curr * (curr + 1)) / 2 + (rightt - curr);
  } else {
    tot +=
        ((curr * (curr + 1)) / 2 - ((curr - rightt) * (curr - rightt + 1)) / 2);
  }
  return tot;
}
int main() {
  cin >> n >> p >> k;
  leftt = k - 1, rightt = n - k;
  long long l = 1, r = 10e9, ans;
  while (l <= r) {
    long long m = l + (r - l) / 2;
    if (check(m) > p)
      r = m - 1;
    else {
      ans = m;
      l = m + 1;
    }
  }
  cout << ans << endl;
}
