#include <bits/stdc++.h>
long long n, H;
long long check(long long len) {
  long long area;
  if (len <= H)
    area = (1 + len) * (((len - 1) > 0 ? (len - 1) : (0 - (len - 1))) + 1) / 2;
  else {
    area = (1 + H - 1) *
           (((H - 1 - 1) > 0 ? (H - 1 - 1) : (0 - (H - 1 - 1))) + 1) / 2;
    len -= H;
    if (len & 1)
      area = area +
             (H + H + len / 2) *
                 (((H + len / 2 - H) > 0 ? (H + len / 2 - H)
                                         : (0 - (H + len / 2 - H))) +
                  1) /
                 2 +
             (H + len / 2 + H) *
                 (((H - H + len / 2) > 0 ? (H - H + len / 2)
                                         : (0 - (H - H + len / 2))) +
                  1) /
                 2;
    else
      area = area +
             (H + H + len / 2) *
                 (((H + len / 2 - H) > 0 ? (H + len / 2 - H)
                                         : (0 - (H + len / 2 - H))) +
                  1) /
                 2 +
             (H + len / 2 - 1 + H) *
                 (((H - H + len / 2 - 1) > 0 ? (H - H + len / 2 - 1)
                                             : (0 - (H - H + len / 2 - 1))) +
                  1) /
                 2;
  }
  return area >= n;
}
long long binsch(long long fr, long long to) {
  long long l = fr - 1, r = to + 1, m;
  while (l + 1 < r) {
    m = (l + r) / 2;
    if (1 != check(m))
      l = m;
    else
      r = m;
  }
  return r;
}
int main() {
  scanf("%lld %lld", &n, &H);
  long long r = 2 * sqrt(n) + 1;
  long long ans = binsch(1, r);
  printf("%lld", ans);
}
