#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios_base::sync_with_stdio(false);
  long long n, m, k;
  cin >> n >> m >> k;
  long long l = 1, r = 1e9 + 1;
  while (r - l > 1) {
    long long mid = (l + r) / 2;
    long long ans = mid;
    if (k >= mid) ans += ((mid - 1) * mid) / 2;
    if (k > mid) ans += k - mid;
    if (k < mid)
      ans += (((mid - 1) + (k - mid)) * ((mid - 1) - (k - mid) + 1)) / 2;
    long long t = n - k + 1;
    if (t >= mid) ans += ((mid - 1) * mid) / 2;
    if (t > mid) ans += t - mid;
    if (t < mid)
      ans += (((mid - 1) + (t - mid)) * ((mid - 1) - (t - mid) + 1)) / 2;
    if (ans > m)
      r = mid;
    else
      l = mid;
  }
  cout << l << endl;
}
