#include <bits/stdc++.h>
using namespace std;
long long n, m, k;
long long sum(long long x) { return (x * (x + 1)) / 2; }
long long range_sum(long long a, long long b) { return sum(b) - sum(a - 1); }
inline long long roll(long long x) {
  long long need = 0;
  long long left_side = max(x - k + 1, 1LL);
  need += range_sum(left_side, x);
  if (k > x) {
    need += k - x;
  }
  long long right_side = max(x - (n - k), 1LL);
  need += range_sum(right_side, x);
  if ((n - k + 1) - x > 0) {
    need += (n - k + 1) - x;
  }
  return need - x;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n >> m >> k;
  long long left = 1, right = (long long)1e9;
  long long ans = -1;
  while (left <= right) {
    long long mid = (left + right) / 2;
    long long need = roll(mid);
    if (need <= m) {
      ans = mid;
      left = mid + 1;
    } else {
      right = mid - 1;
    }
  }
  assert(ans != -1);
  cout << ans << '\n';
  return 0;
}
