#include <bits/stdc++.h>
using namespace std;
using i64 = long long int;
using ii = pair<int, int>;
using ii64 = pair<i64, i64>;
int main() {
  i64 n, m, k;
  scanf("%lld %lld %lld", &n, &m, &k);
  m -= n;
  i64 lo = 0, hi = m;
  i64 ans = 0;
  while (lo <= hi) {
    i64 mid = (lo + hi) / 2;
    i64 l = mid * (mid - 1) / 2;
    if (mid >= k) l -= (mid - k) * (mid - k + 1) / 2;
    i64 r = mid * (mid - 1) / 2;
    if (mid >= n - k + 1) r -= (mid - n + k - 1) * (mid - n + k) / 2;
    if (l + r + mid <= m) {
      ans = mid;
      lo = mid + 1;
    } else {
      hi = mid - 1;
    }
  }
  printf("%lld\n", ans + 1);
  return 0;
}
