#include <bits/stdc++.h>
using namespace std;
long long a[100005];
long long SQRT(long long r) {
  long long lo = 0, hi = 1414213562, me;
  while (lo < hi) {
    me = lo + (hi - lo + 1) / 2;
    if (me * me > r)
      hi = me - 1;
    else
      lo = me;
  }
  return lo;
}
int main() {
  long long n, H;
  cin >> n >> H;
  long double h = H, nn = n;
  long long ans = 0;
  if (h * (h + 1) / 2 + 2 * h >= nn) {
    long long lo = 1, hi = SQRT(2 * n), me;
    while (lo < hi) {
      me = lo + (hi - lo + 1) / 2;
      if (me * (me + 1) > 2 * n)
        hi = me - 1;
      else
        lo = me;
    }
    long long res = n - lo * (lo + 1) / 2;
    if (lo <= H) {
      if (lo * (lo + 1) / 2 == n)
        ans = lo;
      else
        ans = lo + 1;
    } else {
      ans = lo;
      if (lo == H + 1) ans++;
    }
    cout << ans << endl;
  } else {
    long long lo = H + 1, hi = SQRT(2 * n), me;
    long long aux = h * (h - 1) / 2;
    while (lo < hi) {
      me = lo + (hi - lo + 1) / 2;
      if (me * me <= n + aux)
        lo = me;
      else
        hi = me - 1;
    }
    long long res = n - (lo * lo - (H * (H - 1) / 2));
    ans = lo + lo - (H - 1) - 1;
    if (res > lo)
      ans += 2;
    else if (res > 0)
      ans++;
    cout << ans << endl;
  }
}
