#include <bits/stdc++.h>
using namespace std;
int main() {
  std::ios::sync_with_stdio(false);
  long long n, H;
  cin >> n >> H;
  long long l = 1, r = sqrt(2 * n), h1;
  while (r - l > 1) {
    long long d = l + (r - l) / 2;
    h1 = min(H, d);
    if (d * d - h1 * (h1 - 1) / 2 > n)
      r = d;
    else
      l = d;
  }
  long long k;
  h1 = min(r, H);
  if (r * r - h1 * (h1 - 1) / 2 <= n)
    k = r;
  else {
    k = l;
    h1 = min(l, H);
  }
  long long otv = 2 * k - h1;
  long long kol = n - (k * k - h1 * (h1 - 1) / 2);
  if (kol % k == 0)
    otv += kol / k;
  else
    otv += kol / k + 1;
  cout << otv << endl;
  return 0;
}
