#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, h;
  cin >> n >> h;
  long double H = h;
  if (n / H < (h + 1) / 2) {
    long long k = floor(sqrt(2 * n));
    while ((k + 1) < 2.0 * n / k) {
      k++;
    }
    cout << k << endl;
    return 0;
  }
  long long lo = h - 1;
  long long hi = n;
  while (lo + 1 < hi) {
    long long mid = (lo + hi) / 2;
    if ((mid - (int)H) % 2 == 0) {
      long long k = (mid - H) / 2;
      if ((H + k + 1) / 2 + (H + k - 1) / 2 - (H / 2) * ((H - 1) / (H + k)) >=
          n / (H + k)) {
        hi = mid;
      } else {
        lo = mid;
      }
    } else {
      long long k = (mid - H) / 2;
      if ((H + k + 3) / 2 + (H + k - 1) / 2 - (H / 2) * ((H - 1) / (H + k)) >=
          n / (H + k)) {
        hi = mid;
      } else {
        lo = mid;
      }
    }
  }
  cout << hi << endl;
}
