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