#include <bits/stdc++.h>
using namespace std;
long long n, m, k;
bool possible(long long a) {
  long long pilw = 0;
  if (a >= k) {
    pilw += (a * (a + 1)) / 2 - ((a - k) * (a - k + 1)) / 2;
  } else {
    pilw += (a * (a + 1)) / 2 + k - a;
  }
  k = n - k + 1;
  if (a >= k) {
    pilw += (a * (a + 1)) / 2 - ((a - k) * (a - k + 1)) / 2;
  } else {
    pilw += (a * (a + 1)) / 2 + k - a;
  }
  pilw -= a;
  if (pilw > m)
    return false;
  else
    return true;
}
long long b_search(long long low, long long high) {
  while (low <= high) {
    long long mid = (low + high) / 2;
    if (possible(mid)) {
      low = mid + 1;
    } else {
      high = mid - 1;
    }
  }
  if (possible(low)) return low;
  return low - 1;
}
int main() {
  cin >> n >> m >> k;
  cout << b_search(1, m - n) << endl;
}
