#include <bits/stdc++.h>
using namespace std;
long long n, h;
bool ok(long long x) {
  long long ans = 0;
  if (x >= 2e9) return 1;
  if (x <= h)
    ans = x * (x + 1) / 2;
  else {
    ans = h * (h + 1) / 2 + (x - h) * h;
    long long high = x - h - 1;
    long long t1 = high / 2, t2 = high - t1;
    ans += t1 * (t1 + 1) / 2 + t2 * (t2 + 1) / 2;
  }
  if (ans >= n)
    return 1;
  else
    return 0;
}
int main() {
  cin >> n >> h;
  long long l = 1, r = 1e18 + 1;
  long long mid = (l + r) / 2;
  while (l < r) {
    mid = (l + r) / 2;
    if (ok(mid))
      r = mid;
    else
      l = mid + 1;
  }
  printf("%lld\n", l);
  return 0;
}
