#include <bits/stdc++.h>
using namespace std;
const unsigned long long mx = 2e9;
unsigned long long sum(unsigned long long a, unsigned long long b) {
  b = (b * (b + 1)) / 2;
  a = (a * (a - 1)) / 2;
  return b - a;
}
int main() {
  unsigned long long n, H;
  scanf("%lld %lld", &n, &H);
  unsigned long long l = 1, r = min(H, mx), x, y;
  while (l <= r) {
    unsigned long long mid = (l + r) / 2LL;
    if (sum(1, mid) <= n)
      x = mid, l = mid + 1;
    else
      r = mid - 1;
  }
  l = x, r = mx;
  while (l <= r) {
    unsigned long long mid = (l + r) / 2LL;
    if (sum(x, mid) + sum(1, mid - 1) <= n)
      y = mid, l = mid + 1;
    else
      r = mid - 1;
  }
  unsigned long long ans = 2 * y - x;
  n -= sum(x, y) + sum(1, y - 1);
  ans += (n + y - 1) / y;
  printf("%lld\n", ans);
  return 0;
}
