#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, m, k;
  cin >> n >> m >> k;
  long long int lo = 1, hi = m;
  while (lo < hi) {
    long long int mid = lo + (hi - lo + 1) / 2;
    long long int z = ((mid) * (mid + 1)) / 2, l = ((mid) * (mid - 1)) / 2;
    long long int y = mid - k, x = k + mid - n - 1, p = z, q = l;
    if (y >= 0) {
      p = z - (y * (y + 1)) / 2;
    }
    if (x >= 0) q = l - (x * (x + 1)) / 2;
    long long int r = p + q;
    if (y < 0) {
      r = r + (-y);
    }
    if (x < 0) {
      r = r + (-x);
    }
    if (r <= m)
      lo = mid;
    else
      hi = mid - 1;
  }
  cout << lo;
  return 0;
}
