#include <bits/stdc++.h>
const double PI = acos(-1.0);
const int INF = 0x3f3f3f3f;
const double eps = 1e-8;
const int MAXN = 1e6 + 10;
const long long MOD = 1e9 + 7;
int cases = 0;
using std::string;
const int dir[][2] = {{-1, 0}, {-1, -1}, {-1, 1}, {0, -1},
                      {0, 1},  {1, -1},  {1, 0},  {1, 1}};
long long m, idx, k, rem;
bool check(long long n) {
  long long low = std::max(1ll, k - idx);
  long long leftLow = std::min(k - 1, n - 1);
  long long rightLow = std::min(rem, n - 1);
  long long sum = ((n - leftLow) + (n - 1)) * (leftLow) / 2 +
                  (n - 1 + (n - rightLow)) * rightLow / 2 + n +
                  std::max(0ll, k - n) + std::max(0ll, rem - n + 1);
  return sum <= m;
}
int main() {
  int n;
  std::cin >> n >> m >> k;
  long long l = 1, r = m + 1, ans = 1;
  rem = n - k;
  while (l < r) {
    long long mid = (l + ((r - l) >> 1));
    if (check(mid)) {
      l = mid + 1;
      ans = mid;
    } else {
      r = mid;
    }
  }
  printf("%d\n", ans);
  return 0;
}
