#include <bits/stdc++.h>
using namespace std;
long long n, m, k;
bool check(long long mid) {
  long long sum = 0;
  if (k - 1 > 0 && mid - 1 > 0)
    sum = min(k - 1, mid - 1) * (mid + mid - 1 - min(k - 1, mid - 1)) / 2;
  if (n - k > 0 && mid - 1 > 0)
    sum += min(n - k, mid - 1) * (mid + mid - 1 - min(n - k, mid - 1)) / 2;
  if (sum + mid <= m) return 1;
  return 0;
}
int main() {
  scanf("%lld%lld%lld", &n, &m, &k);
  m -= n;
  long long l, d, ans = 0, mid;
  l = 1;
  d = m;
  while (l <= d) {
    mid = (l + d) / 2;
    if (check(mid)) {
      l = mid + 1;
      ans = mid;
    } else
      d = mid - 1;
  }
  printf("%lld\n", ans + 1);
  return 0;
}
