#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:100000000")
using namespace std;
const int MAXN = 61;
long long k, n, m;
bool check(long long val) {
  long long needL = val > k - 1 ? (val - k + 1 + val - 1) * (k - 1) / 2
                                : (1 + val - 1) * (val - 1) / 2 + k - val;
  long long needR = val > n - k
                        ? (val - n + k + val - 1) * (n - k) / 2
                        : (1 + val - 1) * (val - 1) / 2 + n - k - val + 1;
  return needL + needR + val <= m;
}
int binSearch(int left, int right) {
  int l = left - 1;
  int r = right + 1;
  while (r - l > 1) {
    int m = (l + r) / 2;
    if (check(m))
      l = m;
    else
      r = m;
  }
  return l;
}
int main() {
  scanf("%I64d%I64d%I64d", &n, &m, &k);
  int res = binSearch(1, m);
  printf("%d", res);
  return 0;
}
