#include <bits/stdc++.h>
using namespace std;
long long l, r;
long long n, m, k;
int check(long long x) {
  long long left;
  long long right;
  long long sum;
  if (x - k >= 0) {
    left = (x + (x - k + 1)) * k / 2;
  } else {
    left = (1 + x) * x / 2 + (k - x);
  }
  if (x - (n - k) >= 1) {
    right = (n - k + 1) * (x + (x - n + k)) / 2;
  } else {
    right = (1 + x) * x / 2 + (n - k + 1 - x);
  }
  sum = left + right - x;
  if (sum > m) {
    return 1;
  }
  return 0;
}
int main() {
  cin >> n >> m >> k;
  l = 1;
  r = m;
  if (check(r) == 0) {
    cout << r << endl;
  } else {
    while (l < r) {
      long long mid = (l + r) / 2;
      if (check(mid) > 0) {
        r = mid;
      } else {
        l = mid + 1;
      }
    }
    cout << r - 1 << endl;
  }
}
