#include <bits/stdc++.h>
using namespace std;
#pragma comment(linker, "/STACK:667772160")
template <class T1>
void deb(T1 e1) {
  cout << e1 << endl;
}
template <class T1, class T2>
void deb(T1 e1, T2 e2) {
  cout << e1 << " " << e2 << endl;
}
template <class T1, class T2, class T3>
void deb(T1 e1, T2 e2, T3 e3) {
  cout << e1 << " " << e2 << " " << e3 << endl;
}
template <class T1, class T2, class T3, class T4>
void deb(T1 e1, T2 e2, T3 e3, T4 e4) {
  cout << e1 << " " << e2 << " " << e3 << " " << e4 << endl;
}
template <class T1, class T2, class T3, class T4, class T5>
void deb(T1 e1, T2 e2, T3 e3, T4 e4, T5 e5) {
  cout << e1 << " " << e2 << " " << e3 << " " << e4 << " " << e5 << endl;
}
template <class T1, class T2, class T3, class T4, class T5, class T6>
void deb(T1 e1, T2 e2, T3 e3, T4 e4, T5 e5, T6 e6) {
  cout << e1 << " " << e2 << " " << e3 << " " << e4 << " " << e5 << " " << e6
       << endl;
}
int main() {
  long long n, m, k, ans = 0, tp1, tp2, tp;
  scanf("%lld %lld", &n, &m);
  scanf("%lld", &k);
  m -= n;
  long long l = 1, r = m;
  long long mid;
  while (l <= r) {
    mid = (l + r) / 2LL;
    tp1 = (mid * (mid - 1LL));
    tp2 = mid - k;
    tp2 = max(tp2, 0LL);
    tp1 -= (tp2 * (tp2 + 1)) / 2LL;
    tp2 = mid - 1 - (n - k);
    tp2 = max(tp2, 0LL);
    tp1 -= (tp2 * (tp2 + 1)) / 2LL;
    tp1 += mid;
    if (tp1 <= m)
      l = mid + 1;
    else
      r = mid - 1;
  }
  deb(r + 1);
  return 0;
}
