#include <bits/stdc++.h>
long long count(long long h, long long h_) {
  return (h < h_ ? (h_ - h) * (h + h_ - 1) / 2 : 0) + h_ * (h_ + 1) / 2;
}
int main() {
  long long n, h, lower, upper, h_, n_, ans;
  scanf("%lld%lld", &n, &h);
  lower = 0;
  upper = 1;
  while (count(h, upper) <= n) {
    lower = upper;
    upper *= 2;
  }
  while (upper - lower > 1) {
    h_ = (lower + upper) / 2;
    if (count(h, h_) <= n)
      lower = h_;
    else
      upper = h_;
  }
  h_ = lower;
  n_ = n - count(h, h_);
  ans = (h < h_ ? h_ - h : 0) + h_ + (n_ + h_ - 1) / h_;
  printf("%lld\n", ans);
  return 0;
}
