#include <bits/stdc++.h>
using namespace std;
const long long INF = 2e9 + 10;
long long n, h;
long long cal1(long long x) { return x * (x + 1) / 2; }
bool ok1(long long x) { return cal1(x) <= n; }
long long min(long long x, long long y) { return x < y ? x : y; }
long long cal2(long long x) {
  return x * (x + 1) / 2 + (x - 1 + h) * (x - h) / 2;
}
bool ok2(long long x) { return cal2(x) <= n; }
void work() {
  scanf("%lld%lld", &n, &h);
  long long l = 1, r = INF, mid;
  while (l < r - 5) {
    mid = l + (r - l) / 2;
    if (ok1(mid))
      l = mid;
    else
      r = mid;
  }
  while (l <= r && ok1(l)) l++;
  l--;
  long long res = 1e18 + 10;
  if (l <= h) {
    if (cal1(l) == n)
      res = min(res, l);
    else
      res = min(res, l + 1);
  } else {
    long long re = 0;
    long long p = cal1(h);
    re = h + (n - p) / h;
    if ((n - p) % h != 0) re++;
    res = min(res, re);
    l = 1, r = INF, mid;
    while (l < r - 5) {
      mid = l + (r - l) / 2;
      if (ok2(mid))
        l = mid;
      else
        r = mid;
    }
    while (l <= r && ok2(l)) l++;
    l--;
    if (cal2(l) == n)
      res = min(res, l + l - h + 0);
    else if (n - cal2(l) <= l)
      res = min(res, l + l - h + 1);
    else
      res = min(res, l + l - h + 2);
  }
  printf("%lld\n", res);
}
int main() {
  work();
  return 0;
}
