#include <bits/stdc++.h>
long long n, m, k;
long long min_pillow(long long a) {
  long long L, R;
  if (a - k + 1 > 1)
    L = k * a - k * (k - 1) / 2;
  else
    L = k - a + a * (a + 1) / 2;
  if (a - n + k > 1)
    R = (n - k) * a - (n - k) * (n - k + 1) / 2;
  else
    R = n - k - a + 1 + a * (a - 1) / 2;
  return L + R;
}
long long solve(long long l, long long r) {
  if (l == r) return l;
  if (l + 1 == r) {
    if (min_pillow(r) <= m)
      return r;
    else
      return l;
  }
  long long mX = (l + r) / 2;
  long long mV = min_pillow(mX);
  if (mV <= m)
    return solve(mX, r);
  else
    return solve(l, mX);
}
int main() {
  scanf("%I64d%I64d%I64d", &n, &m, &k);
  printf("%I64d\n", solve(1, m - n + 1));
  return 0;
}
