#include <bits/stdc++.h>
using namespace std;
long long n, H, ans = 0x7f7f7f7f7f7f7f7f;
bool check(long long h) {
  long long need, ret;
  if (h > H) {
    need = (long long)(1.0 * (h + H) * (h - H + 1) / 2 + 1.0 * (h + 1) * h / 2 -
                       h);
    ret = h - H + h;
  } else {
    need = (long long)(1.0 * (h + 1) * h / 2);
    ret = h;
  }
  if (need > n) return false;
  long long last = n - need;
  ret += last / h + (last % h > 0);
  if (ret <= ans) {
    ans = ret;
    return true;
  }
  return false;
}
int main() {
  std::cin >> n >> H;
  long long l = 1, r = int(2e9) + 7, mid;
  while (l <= r) {
    mid = l + r >> 1;
    if (check(mid))
      l = mid + 1;
    else
      r = mid - 1;
  }
  printf("%lld\n", ans);
  return 0;
}
