#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  long long n, h;
  cin >> n >> h;
  long long lo, mid, hi;
  lo = 1;
  hi = 2000000000;
  while (lo < hi) {
    mid = lo + (hi - lo) / 2;
    long long mx;
    if (h >= mid) {
      mx = (mid * (mid + 1)) / 2;
    } else {
      mx = (h * (h + 1)) / 2;
      mx += (mid - h) * h;
      long long ind = mid - h - 1;
      mx += (ind / 2) * ((ind / 2) + 1);
      if (ind % 2) mx += (ind / 2) + 1;
    }
    if (mx >= n)
      hi = mid;
    else
      lo = mid + 1;
  }
  cout << lo;
  return 0;
}
