#include <bits/stdc++.h>
using namespace std;
long long n, h;
long long cal(long long x, long long y) {
  return (x + y) * (llabs(x - y) + 1) / 2;
}
long long check(long long len) {
  if (len <= h) {
    return cal(1, len);
  } else {
    len -= h;
    long long area = cal(h - 1, 1);
    if (len & 1) {
      area += cal(h, h + len / 2) + cal(h + len / 2, h);
    } else {
      area += cal(h, h + len / 2) + cal(h + len / 2 - 1, h);
    }
    return area;
  }
}
int main() {
  while (cin >> n >> h) {
    long long l = 0, r = 2e9 + 7;
    while (l + 1 < r) {
      long long mid = (l + r) >> 1;
      if (check(mid) < n)
        l = mid;
      else
        r = mid;
    }
    cout << r << endl;
  }
  return 0;
}
