#include <bits/stdc++.h>
using namespace std;
long long n, h;
int judge1(long long mid) {
  if ((double)(mid + 1) >= 2.0 * n / mid) return 1;
  return 0;
}
int judge2(long long mid) {
  long long tmp = (mid - h + 1) / 2;
  long long sum = (h + h + tmp - 1) * tmp + (h - 1) * h / 2;
  if ((mid - h + 1) % 2) sum += (h + tmp);
  if (sum >= n) return 1;
  return 0;
}
int main() {
  cin >> n >> h;
  if ((double)(h + 1) >= 2.0 * n / h) {
    long long l = 1, r = h, ans, mid;
    while (l <= r) {
      mid = l + r >> 1;
      if (judge1(mid))
        ans = mid, r = mid - 1;
      else
        l = mid + 1;
    }
    cout << ans << '\n';
  } else {
    long long l = h, r = 2e9, ans, mid;
    while (l <= r) {
      mid = l + r >> 1;
      if (judge2(mid))
        ans = mid, r = mid - 1;
      else
        l = mid + 1;
    }
    cout << ans << '\n';
  }
}
