#include <bits/stdc++.h>
using namespace std;
long long n, h;
const long long lim = 2000000000ll;
bool check(long long x) {
  long long maxx;
  if (x <= h) {
    if (x >= lim) return 1;
    maxx = (1 + x) * x / 2;
  } else {
    long long t = (x + h) / 2;
    if (t >= lim) return 1;
    maxx = (1 + t) * t / 2;
    if (h + x - t == t)
      maxx += (h + t - 1) * (t - 1 - h + 1) / 2;
    else
      maxx += (h + t) * (t - h + 1) / 2;
  }
  if (maxx >= n)
    return 1;
  else
    return 0;
}
int main() {
  scanf("%I64d%I64d", &n, &h);
  long long l = 1, r = n, mid, ans;
  while (l <= r) {
    mid = (l + r) >> 1;
    if (check(mid))
      ans = mid, r = mid - 1;
    else
      l = mid + 1;
  }
  printf("%I64d\n", ans);
}
