#include <bits/stdc++.h>
using namespace std;
int n, m, k;
using ll = long long;
bool check(ll mid) {
  ll aux = min(mid, (ll)n - k);
  ll aux2 = min((ll)k - 1, mid);
  ll cur = mid;
  cur += (aux2 - 1) * aux2 / 2;
  cur += aux2 * (mid - aux2);
  cur += (aux - 1) * aux / 2;
  cur += aux * (mid - aux);
  return cur <= m;
}
int main() {
  cin >> n >> m >> k;
  m -= n;
  ll ans = 0;
  ll lo = 0, hi = m;
  while (lo <= hi) {
    ll mid = lo + (hi - lo) / 2;
    if (check(mid)) {
      lo = mid + 1;
      ans = max(ans, mid);
    } else {
      hi = mid - 1;
    }
  }
  cout << ans + 1 << endl;
  return 0;
}
