#include <bits/stdc++.h>
using namespace std;
long long cnt = 2000000000;
long long n, h, x, num;
int check(long long x) {
  if (x <= h) return x > cnt ? 1 : x * (x + 1) / 2 >= n;
  long long a = (x - h) / 2 + h;
  if (a > cnt) return 1;
  if ((x - h) % 2 != 0) return a * (a + 1) / 2 + (a + h) * (a + 1 - h) / 2 >= n;
  return a * (a + 1) / 2 + (a + h) * (a + 1 - h) / 2 - a >= n;
}
int main() {
  scanf("%lld%lld", &n, &h);
  long long l = 1, r = n;
  while (l <= r) {
    long long mid = (l + r) / 2;
    if (check(mid))
      r = mid - 1;
    else
      l = mid + 1;
  }
  cout << r + 1 << endl;
  return 0;
}
