#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  long long int n, m, k;
  cin >> n >> m >> k;
  m -= n;
  long long int ans = 0;
  long long int l = 0, h = m;
  while (l <= h) {
    long long int mid = (l + h) / 2;
    long long int left = k - 1;
    long long int right = n - k;
    long long int sum = mid;
    if (left < mid) {
      long long int d = mid - left - 1;
      sum += ((mid * (mid - 1)) / 2 - (d * (d + 1)) / 2);
    } else {
      sum += (mid * (mid - 1)) / 2;
    }
    if (right < mid) {
      long long int d = mid - right - 1;
      sum += ((mid * (mid - 1)) / 2 - (d * (d + 1)) / 2);
    } else {
      sum += (mid * (mid - 1)) / 2;
    }
    if (sum <= m) {
      ans = max(ans, mid);
      l = mid + 1;
    } else {
      h = mid - 1;
    }
  }
  cout << ans + 1;
}
