#include <bits/stdc++.h>
using namespace std;
long long n, H;
bool check(long long maxh) {
  long long h = min(maxh, H);
  return maxh * maxh - h * (h - 1) / 2 <= n;
}
int main(int argc, char const *argv[]) {
  scanf("%lld%lld", &n, &H);
  long long l = 1, r = 2e9;
  while (l + 1 < r) {
    long long mid = (l + r) / 2;
    if (check(mid)) {
      l = mid;
    } else {
      r = mid;
    }
  }
  long long mx;
  if (check(r)) {
    mx = r;
  } else {
    mx = l;
  }
  long long h = min(mx, H);
  long long ans = mx * 2 - h;
  long long left = n - (mx * mx - h * (h - 1) / 2);
  cerr << ans << " " << left << endl;
  ans += left / mx + (left % mx > 0);
  std::cout << ans << '\n';
  return 0;
}
