#include <bits/stdc++.h>
using namespace std;
long long n, H;
long long bsearch(long long left, long long right) {
  long long ret = -1, mid, tot;
  while (left <= right) {
    mid = left + (right - left) / 2;
    int flag = 0;
    if (H >= mid) {
      tot = mid * (mid + 1);
      if (tot / mid != mid + 1)
        flag = 1;
      else {
        tot = tot / 2;
      }
    } else {
      long long k = (mid - H) / 2;
      long long tempH = H + k;
      long long sum1 = (tempH + 1) * tempH;
      if (sum1 / tempH != tempH + 1) flag = 1;
      sum1 = sum1 / 2;
      long long sum2 = (H + tempH - 1) * k;
      if (sum2 / (H + tempH - 1) != k) flag = 1;
      sum2 = sum2 / 2;
      tot = sum1 + sum2;
      if ((mid - H) % 2) tot += tempH;
    }
    if (tot >= n) flag = 1;
    if (flag) {
      ret = mid;
      right = mid - 1;
    } else {
      left = mid + 1;
    }
  }
  return ret;
}
int main() {
  scanf("%lld %lld", &n, &H);
  long long ans = bsearch(1, n);
  printf("%lld\n", ans);
  return 0;
}
