#include <bits/stdc++.h>
using namespace std;
const long long NMAX = 1000000;
long long v[NMAX + 2];
long long N, H;
long long ans = 0;
string str[NMAX + 2];
bool over(long long a, long long b) {
  long long r = a + b;
  return 0;
  if (r > 0 && r - b == a && a - r == -b) return 0;
  return 1;
}
long long OK(long long top) {
  long long rig = top * (top + 1) / 2;
  long long lef = 0;
  if (top > H) lef = rig - top - H * (H - 1) / 2;
  if (over(rig, lef) || lef + rig > N) return 0;
  long long rem = N - rig - lef;
  long long steps = top;
  if (top > H) steps += (top - H);
  steps += rem / top;
  rem %= top;
  if (rem) ++steps;
  assert(steps > 0);
  return steps;
}
int main() {
  cin >> N >> H;
  long long st = 1, dr = 2e9, ans = 0;
  while (st <= dr) {
    long long mid = (st + dr) / 2;
    if (OK(mid)) {
      ans = OK(mid);
      st = mid + 1;
    } else {
      dr = mid - 1;
    }
  }
  cout << ans << '\n';
  return 0;
}
