#include <bits/stdc++.h>
using namespace std;
long long n, m, k;
long long sum(long long x) { return x * (x + 1) / 2; }
long long calc(long long x) {
  long long L = sum(x - 1) - ((k >= x) ? 0ll : sum(x - k));
  long long R = sum(x - 1) - ((n - k + 1 >= x) ? 0ll : sum(x - (n - k + 1)));
  return L + R + x;
}
int main() {
  scanf("%I64d %I64d %I64d", &n, &m, &k);
  m -= n;
  long long l = 0, r = m, ans;
  while (l <= r) {
    long long x = (l + r) / 2;
    if (calc(x) <= m)
      l = x + 1, ans = x;
    else
      r = x - 1;
  }
  printf("%I64d\n", ans + 1);
}
