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