#include <bits/stdc++.h>
using namespace std;
int n, m, k;
bool can(int mid) {
  long long sum = 0LL;
  if (mid <= k) {
    sum += (mid + 1) * 1LL * mid / 2;
    sum += k - mid;
  } else {
    sum += (mid + mid - k + 1) * 1LL * k / 2;
  }
  int q = n - k;
  mid--;
  if (mid <= q) {
    sum += (mid + 1) * 1LL * mid / 2;
    sum += q - mid;
  } else {
    sum += (mid + mid - q + 1) * 1LL * q / 2;
  }
  if (sum <= m) return true;
  return false;
}
int main() {
  cin >> n >> m >> k;
  int l = 1, r = (int)1e9 + 100;
  while (r - l > 1) {
    int mid = (l + r) / 2;
    if (can(mid)) {
      l = mid;
    } else {
      r = mid;
    }
  }
  cout << l;
  return 0;
}
