#include <bits/stdc++.h>
using namespace std;
long long int ans, high, low;
long long int func(long long int x) { return x * (x + 1) / 2; }
long long int upBin(long long int x) {
  low = x;
  x = (low + high) / 2;
  return x;
}
long long int lowBin(long long int x) {
  high = x;
  x = (low + high) / 2;
  return x;
}
int main() {
  long long int n, m, k;
  while (cin >> n >> m >> k) {
    if (n == 1) {
      cout << m << endl;
      continue;
    }
    low = 1;
    high = m;
    ans = (low + high) / 2;
    while (1) {
      long long int l = k - 1;
      long long int r = n - k;
      long long int temp = 0;
      if (ans - 1 > r) {
        temp += func(ans - 1) - func(ans - r - 1);
      } else {
        temp += func(ans - 1) + r - (ans - 1);
      }
      if (ans - 1 > l) {
        temp += func(ans - 1) - func(ans - l - 1);
      } else {
        temp += func(ans - 1) + l - (ans - 1);
      }
      temp += ans;
      if (temp > m)
        ans = lowBin(ans);
      else
        ans = upBin(ans);
      if (ans == low || ans == high) break;
    }
    cout << ans << endl;
  }
  return 0;
}
