#include <bits/stdc++.h>
using namespace std;
long long n, h;
long long C(long long l, long long r) {
  if (l > r) swap(l, r);
  return (l + r) * (r - l + 1) / 2;
}
int Check(int x) {
  long long sum = 0, m = (x + h) / 2;
  if (x <= h) return C(x, 1) >= n;
  sum = C(h, m) + C(((x + h) & 1 ? m : m - 1), 1);
  return sum >= n;
}
int main() {
  scanf("%lld%lld", &n, &h);
  int nl = 1, nr = 2 * sqrt(n) + 1, re = 0;
  for (int md; nl <= nr;) {
    md = ((long long)nl + nr) >> 1;
    if (Check(md)) {
      re = md;
      nr = md - 1;
    } else {
      nl = md + 1;
    }
  }
  printf("%d\n", re);
  return 0;
}
