#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007;
long long POW(long long a, long long b, long long MMM = MOD) {
  long long ret = 1;
  for (; b; b >>= 1, a = (a * a) % MMM)
    if (b & 1) ret = (ret * a) % MMM;
  return ret;
}
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
long long lcm(long long a, long long b) {
  if (a == 0 || b == 0) return a + b;
  return a * (b / gcd(a, b));
}
int dx[] = {0, 1, 0, -1}, dy[] = {1, 0, -1, 0};
int ddx[] = {0, 0, 1, 1, 1, -1, -1, -1}, ddy[] = {1, -1, 1, 0, -1, 1, 0, -1};
unsigned long long n, h;
int main() {
  scanf("%llu%llu", &n, &h);
  unsigned long long l = 1, r = 2000000001;
  unsigned long long tot;
  while (l <= r) {
    unsigned long long k = (l + r) >> 1;
    if (k <= h)
      tot = k * (k + 1) / 2;
    else {
      unsigned long long t = (k + h) >> 1;
      tot = t * (t + 1) / 2 + (h + t) * (t - h + 1) / 2;
      if ((k + h) % 2 == 0) tot -= t;
    }
    if (tot >= n)
      r = k - 1;
    else
      l = k + 1;
  }
  printf("%llu", l);
}
