#include <bits/stdc++.h>
using lint = long long int;
using pii = std::pair<int, int>;
using std::vector;
lint cal(lint n, lint t, lint k) {
  lint ret = t * t;
  if (t < k) {
    ret += (k - t);
  } else {
    ret -= (t - k) * (t - k + 1) / 2;
  }
  if (t <= n - k) {
    ret += (n - k - t + 1);
  } else {
    ret -= (t - n + k) * (t - n + k - 1) / 2;
  }
  return ret;
}
int main(void) {
  lint n, m, k;
  scanf("%lld %lld %lld", &n, &m, &k);
  lint left = 1, right = m;
  while (left < right) {
    lint mid = (left + right) / 2 + 1;
    lint cur = cal(n, mid, k);
    if (cur <= m) {
      left = mid;
    } else {
      right = mid - 1;
    }
  }
  printf("%lld", left);
  return 0;
}
