#include <bits/stdc++.h>
using namespace std;
long long int n, m, k;
bool check(long long int x) {
  long long int res = 0;
  long long int beds = n - k;
  if (beds > x - 1)
    res += (x * (x - 1)) / 2 + beds - (x - 1);
  else
    res += ((x - 1 + x - beds) * beds) / 2;
  beds = k - 1;
  if (beds > x - 1)
    res += (x * (x - 1)) / 2 + beds - (x - 1);
  else
    res += ((x - 1 + x - beds) * beds) / 2;
  res += x;
  return (res <= m);
}
int main() {
  cin >> n >> m >> k;
  int l = 1, r = m, ans = 0;
  while (l <= r) {
    int mid = (l + r) / 2;
    if (check(mid)) {
      ans = mid;
      l = mid + 1;
    } else
      r = mid - 1;
  }
  cout << ans << "\n";
}
