#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  ;
  long long n, h;
  cin >> n >> h;
  long long low = 1;
  long long high = 2e9;
  long long ans = high;
  while (low <= high) {
    long long mid = (low + high) >> 1;
    long long xx = max(0LL, (mid - h + 2) / 2);
    long long yy = mid - xx;
    long long sum =
        (double)yy * (yy + 1) / 2 + (double)(xx * (2 * h + xx - 1) / 2);
    if (sum >= n) {
      ans = mid;
      high = mid - 1;
    } else
      low = mid + 1;
  }
  cout << ans;
}
