#include <bits/stdc++.h>
using namespace std;
bool cando(long long mid, long long n, long long m, long long k) {
  long long left = k - 1;
  long long right = n - k;
  long long pill = 0;
  pill += (mid - 1) * (mid);
  pill += mid;
  if (mid - right > 1) {
    long long temp = mid - right;
    temp--;
    pill -= temp * (temp + 1) / 2;
  } else if (mid - right < 1) {
    pill += right - (mid - 1);
  }
  if (mid - left > 1) {
    long long temp = mid - left;
    temp--;
    pill -= temp * (temp + 1) / 2;
  } else if (mid - left < 1) {
    pill += left - (mid - 1);
  }
  if (pill <= m)
    return true;
  else
    return false;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n, m, k;
  cin >> n >> m >> k;
  long long l = 1, r = m, ans;
  while (l <= r) {
    long long mid = l + (r - l) / 2;
    if (cando(mid, n, m, k)) {
      ans = mid;
      l = mid + 1;
    } else
      r = mid - 1;
  }
  cout << ans;
  return 0;
}
