#include <bits/stdc++.h>
using namespace std;
long long mod = 1000000007;
int n, m, k;
int a[100000];
int b[100000];
vector<vector<int>> v;
vector<int> s;
map<int, int> mp;
long long check(int h) {
  long long r = min(h + k, n);
  long long l = ((k - h >= 1) ? k - h : 1);
  long long ans = (r - k + 1) * (2 * h + k - r) / 2 +
                  (k - l + 1) * (2 * h + l - k) / 2 - h - m;
  if (ans <= 0)
    return true;
  else
    return false;
}
void solve() {
  cin >> n >> m >> k;
  m -= n;
  if (check(m))
    cout << m + 1 << endl;
  else {
    int h1 = m;
    int ans = 0;
    int h2 = 0;
    int mid;
    while (h2 < h1) {
      mid = (h1 + h2) / 2;
      if (check(mid))
        h2 = mid + 1, ans = max(ans, mid);
      else
        h1 = mid;
    }
    cout << ans + 1 << endl;
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  solve();
  return 0;
}
