#include <bits/stdc++.h>
using namespace std;
void rd(int &x) {
  x = 0;
  int f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch <= '9' && ch >= '0') x = x * 10 + ch - '0', ch = getchar();
  x *= f;
}
const int INF = 1e9;
const long long LINF = 1e18;
long long n, h;
int main() {
  scanf("%lld%lld", &n, &h);
  long long l = 1, r = sqrt(2 * n);
  while (l != r) {
    long long mid = (l + r >> 1) + 1;
    if (mid * (mid + 1) > n * 2)
      r = mid - 1;
    else
      l = mid;
  }
  if (l <= h) {
    if (l * (l + 1) != n * 2) l++;
    printf("%lld\n", l);
  } else {
    l = h, r = sqrt(2 * n);
    while (l != r) {
      long long mid = (l + r >> 1) + 1;
      if ((mid - 1 + h) * (mid - h) + mid * (mid + 1) > n * 2)
        r = mid - 1;
      else
        l = mid;
    }
    long long u = n - ((l - 1 + h) * (l - h) + l * (l + 1)) / 2;
    if (!u)
      printf("%lld\n", l + l - h);
    else if (u <= l)
      printf("%lld\n", l + 1 + l - h);
    else
      printf("%lld\n", l + 2 + l - h);
  }
  return 0;
}
