#include <bits/stdc++.h>
using namespace std;
long long int i, j, n;
long long int m, k;
bool check(long long int x) {
  long long int left = k - 1;
  long long int right = n - k;
  long long int req = 0;
  long long int leftmost = x - (k - 1);
  long long int rightmost = x - (n - k);
  if (leftmost <= 1)
    req += (x * (x + 1)) / 2;
  else
    req += (x * (x + 1)) / 2 - (leftmost * (leftmost - 1)) / 2;
  if (rightmost <= 1) {
    req += (x * (x + 1)) / 2;
  } else {
    req += (x * (x + 1)) / 2 - (rightmost * (rightmost - 1)) / 2;
  }
  req -= x;
  if (req <= m)
    return 1;
  else
    return 0;
}
int main() {
  cin >> n >> m >> k;
  m -= n;
  long long int ans = -1, l = 0, r = m;
  while (l <= r) {
    long long int mid = (l + r) / 2;
    bool val = check(mid);
    if (val) {
      ans = max(ans, mid);
      l = mid + 1;
    } else
      r = mid - 1;
  }
  cout << ans + 1;
  return 0;
}
