#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:5000000000")
const long long mod = 1000000007;
long long Inf = (long long)2e9;
long long LINF = (long long)1e18 + 1e17;
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  long long n, h;
  cin >> n >> h;
  if (h >= 2e9) {
    long long l = 0, r = 2e9;
    while (r - l > 1) {
      long long m = (r + l) / 2;
      if (m * (m + 1) / 2 >= n) {
        r = m;
      } else {
        l = m;
      }
    }
    cout << r;
    return 0;
  }
  if (n <= h * (h + 1) / 2) {
    long long l = 0, r = h;
    while (r - l > 1) {
      long long m = (r + l) / 2;
      if (m * (m + 1) / 2 >= n)
        r = m;
      else
        l = m;
    }
    cout << r;
    return 0;
  }
  long long l = 0, r = 2e9;
  while (r - l > 1) {
    long long m = (r + l) / 2;
    long long cnt = (h + m) * (h + m + 1) / 2 - h * (h - 1) / 2;
    long long tmp = (h + m) * (h + m - 1) / 2;
    if (cnt + tmp <= n)
      l = m;
    else
      r = m;
  }
  long long cnt = (h + l) * (h + l + 1) / 2 - h * (h - 1) / 2;
  long long tmp = (h + l) * (h + l - 1) / 2;
  n = n - cnt - tmp;
  long long ans = l + 1 + h + l - 1;
  ans += (n + (h + l - 1)) / (h + l);
  cout << ans;
  return 0;
}
