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