#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, h, top;
  cin >> n >> h;
  if (double(1 + h) * double(h) > double(n << 1)) {
    top = sqrt(n << 1);
    cout << (top * (top + 1) >= n << 1 ? top : top + 1);
    exit(0);
  }
  n -= h * (h - 1) >> 1;
  top = sqrt(n + h * (h - 1));
  n -= (h + top) * (top - h + 1) - top;
  cout << top - h + top + n / top + (n % top > 0);
  return 0;
}
