#include <bits/stdc++.h>
using namespace std;
const long long N = 2e9;
long long sum(long long l, long long r) { return (l + r) * (r - l + 1) / 2; }
int main() {
  long long n, H;
  cin >> n >> H;
  long long l = H, r = 2e9, ans = -1;
  while (l <= r) {
    long long mid = (l + r) >> 1;
    if (n >= sum(H, mid) + sum(1, mid) - mid)
      ans = mid, l = mid + 1;
    else
      r = mid - 1;
  }
  if (ans != -1) {
    cout << 2 * ans - H +
                ((n - sum(H, ans) - sum(1, ans) + ans) + ans - 1) / ans
         << endl;
  } else {
    l = 1, r = min(H, N);
    while (l <= r) {
      long long mid = (l + r) >> 1;
      if (n >= sum(1, mid))
        ans = mid, l = mid + 1;
      else
        r = mid - 1;
    }
    cout << ans + (n - sum(1, ans) + ans - 1) / ans << endl;
  }
  return 0;
}
