#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  ll n, m, k;
  cin >> n >> m >> k;
  m -= n;
  n--;
  k--;
  ll lo = 0, hi = m;
  while (lo < hi) {
    ll mid = (lo + hi + 1) / 2;
    ll r = mid - 1;
    ll num = r * (r + 1) / 2;
    ll mum = r * (r + 1) / 2;
    if (k < r) num -= (r - k) * (r - k + 1) / 2;
    if (n - k < r) mum -= (r - (n - k)) * (r - (n - k) + 1) / 2;
    if (num + mum + mid > m)
      hi = mid - 1;
    else
      lo = mid;
  }
  cout << lo + 1;
}
