#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cout.precision(20);
  long long int n, h;
  cin >> n >> h;
  long long int sh = (h * (h + 1)) / 2;
  long long int pp = (-1 + sqrt(1 + 8 * n));
  if (pp <= 2 * h) {
    long long int ans = 0;
    long long int remain = n;
    long long int kk = sqrt(n);
    while (kk * (kk + 1) <= 2 * n) kk++;
    kk--;
    ans += kk;
    remain -= (kk * (kk + 1)) / 2;
    if (remain) {
      ans++;
    }
    cout << ans;
  } else if (n >= sh && n <= sh + 2 * h) {
    long long int ans = h;
    long long int remain = n - sh;
    if (remain) {
      ans += (remain / h);
      remain %= h;
    }
    if (remain) ans += 1;
    cout << ans << endl;
  } else {
    long long int ans = h + 1;
    long long int remain = n - sh - h;
    ;
    long long int kk =
        (-1 - 2 * h + sqrt((1 + 2 * h) * (1 + 2 * h) + 4 * remain)) / 2;
    ;
    ans += 2 * kk;
    remain -= (2 * kk * h + kk * (kk + 1));
    if (remain) {
      ans += (remain / (h + kk + 1));
      remain -= (remain / (h + kk + 1)) * (h + kk + 1);
    }
    if (remain) ans++;
    cout << ans << endl;
  };
  return 0;
}
