#include <bits/stdc++.h>
using namespace std;
int main() {
  std::ios_base::sync_with_stdio(0);
  long long int n, m, k, i, j, f, tt, ss, left, right, hi, mid, lo, ans, suma,
      sumb, dude, sumsum, sumc, sumd, mid2, mid3;
  mid3 = 0;
  long long int a, b, c, d;
  cin >> n >> m >> k;
  if (n == 1) {
    cout << m;
    return 0;
  }
  left = k - 1;
  right = n - k;
  m = m - n;
  hi = m;
  lo = 1;
  mid = 1;
  mid2 = 0;
  while (hi >= lo) {
    mid = hi + lo;
    mid = mid / 2;
    int fff = 0;
    a = 0;
    b = 0;
    c = 0;
    d = 0;
    suma = 0;
    sumc = 0;
    if (left < mid) {
      suma = mid * left;
      dude = left * (left + 1);
      dude = dude / 2;
      suma = suma - dude;
      mid2 = mid2 - suma;
      if (mid2 < 0) fff = 1;
      b = 1;
    } else if (left >= mid) {
      suma = mid * mid;
      suma = suma - mid;
      suma = suma / 2;
      mid2 = mid2 - suma;
      a = 1;
    }
    if (mid - 1 >= right) {
      sumc = mid * right;
      dude = right * (right + 1);
      dude = dude / 2;
      sumc = sumc - dude;
      mid2 = mid2 - sumc;
      if (mid2 < 0) fff = 1;
      d = 1;
    } else if (mid - 1 < right) {
      sumc = mid * mid;
      sumc = sumc - mid;
      sumc = sumc / 2;
      mid2 = mid2 - sumc;
      c = 1;
    }
    sumsum = sumc + suma;
    sumsum = sumsum + mid;
    if (sumsum > m) {
      hi = mid - 1;
    } else if (sumsum <= m) {
      mid3 = mid;
      lo = mid + 1;
    }
  }
  cout << mid3 + 1;
  return 0;
}
