#include <bits/stdc++.h>
using namespace std;
long long n, m, k;
bool solve(long long x) {
  long long leftest = max(1ll, x - (k - 1)), rightest = max(1ll, x - (n - k));
  long long sum = (leftest + (x - 1)) * (x - leftest) / 2;
  sum += (rightest + (x - 1)) * (x - rightest) / 2;
  sum += x;
  return (sum <= m);
}
int main() {
  cin >> n >> m >> k;
  m -= n;
  long long l = 0, r = m;
  while (l < r) {
    long long mid = (l + r + 1) / 2;
    if (solve(mid))
      l = mid;
    else
      r = mid - 1;
  }
  cout << l + 1 << endl;
  return 0;
}
