#include <bits/stdc++.h>
using namespace std;
#pragma warning(disable : 4996)
long long int n, h;
int check(long long int k) {
  if (k <= h) {
    return k * (k + 1) >= 2 * n ? 1 : 0;
  } else {
    long long int cha = k - h;
    if (cha % 2)
      return (1 + h + cha / 2) * (h + cha / 2) +
                         (h + h + cha / 2) * (cha / 2 + 1) >=
                     2 * n
                 ? 1
                 : 0;
    else
      return (1 + h + cha / 2) * (h + cha / 2) +
                         (h + h + cha / 2 - 1) * cha / 2 >=
                     2 * n
                 ? 1
                 : 0;
  }
}
int main() {
  while (scanf("%lld %lld", &n, &h) != EOF) {
    long long int left, right, mid;
    left = 0;
    right = 0x3f3f3f3f * 2;
    while (left <= right - 1) {
      mid = (left + right) / 2;
      if (check(mid))
        right = mid;
      else
        left = mid + 1;
    }
    printf("%lld\n", left);
  }
}
