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