#include <bits/stdc++.h>
static const int MAXN = 1000008;
const int INF = 2e9;
static long long n, h;
using namespace std;
int main() {
  ios::sync_with_stdio();
  cin.tie();
  cin >> n >> h;
  long long l = 1;
  long long r = INF;
  while (r - l > 1) {
    long long m = (r + l) / 2;
    long long k = min(h, m);
    if (m * m - (k - 1) * k / 2 <= n)
      l = m;
    else
      r = m;
  }
  long long k = min(h, l);
  cout << (2 * l - 1) - (k - 1) + (n - (l * l - (k - 1) * k / 2) + (l - 1)) / l;
}
