#include <bits/stdc++.h>
#pragma GCC optimize("no-stack-protector")
#pragma GCC optimize("fast-math")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("O3")
using namespace std;
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  long long n, h;
  cin >> n >> h;
  long long l = 0, r = 2e9 + 1;
  while (r - l > 1) {
    long long m = (l + r) / 2;
    long long k = m;
    if (k > h) k = h;
    if (m * m - k * (k - 1) / 2 <= n)
      l = m;
    else
      r = m;
  }
  long long p = r;
  long long k = p;
  if (k > h) k = h;
  if (p * p - k * (k - 1) / 2 > n) p--;
  k = p;
  if (k > h) k = h;
  cout << 2 * p - k + (n - (p * p - k * (k - 1) / 2) + p - 1) / p;
}
