#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios::sync_with_stdio(0);
  cout.tie(0);
  cin.tie(0);
  long long n, H;
  cin >> n >> H;
  auto sum = [&](long long l, long long r) {
    return r * (r + 1) / 2 - l * (l - 1) / 2;
  };
  long long l = 1, r = 2e9;
  while (l < r) {
    long long mid = (l + r) / 2;
    long long x = min(H, mid);
    long long len = mid - x;
    long long csum = sum(x, x + len / 2) + sum(1, x - 1 + (len + 1) / 2);
    if (csum >= n)
      r = mid;
    else
      l = mid + 1;
  }
  cout << l << '\n';
}
