#include <bits/stdc++.h>
using namespace std;
int main() {
  long long l, r, mid, n, ans, H;
  __int128 t, h;
  scanf("%lld%lld", &n, &H), t = (__int128)(1 + H) * H / 2;
  if (t >= n) {
    for (l = 1, r = H; l <= r;) {
      mid = (l + r) >> 1, t = (__int128)(1 + mid) * mid / 2;
      if (t >= n)
        ans = mid, r = mid - 1;
      else
        l = mid + 1;
    }
  } else {
    for (l = H + 1, r = n; l <= r;) {
      mid = (l + r) >> 1;
      h = (H + mid) / 2, t = h * (h + 1) / 2 + (H + h - 1) * (h - H) / 2;
      if ((H + mid) & 1) t += h;
      if (t >= n)
        ans = mid, r = mid - 1;
      else
        l = mid + 1;
    }
  }
  printf("%lld\n", ans);
  return 0;
}
