#include <bits/stdc++.h>
using namespace std;
long long n, H;
int main() {
  ios::sync_with_stdio(0);
  cin >> n >> H;
  long long low = 1, high = H;
  while (low < high) {
    long long mid = (low + high + 1) / 2;
    if (mid < 1500000000 && mid * (mid + 1) / 2 <= n)
      low = mid;
    else
      high = mid - 1;
  }
  if (low < H) {
    n -= low * (low + 1) / 2;
    cout << low + (n + low - 1) / low << "\n";
    return 0;
  }
  low = 0, high = 1e9;
  while (low < high) {
    long long mid = (low + high + 1) / 2;
    if (((2 * H + mid - 1) * mid + (H + mid) * (H + mid + 1)) / 2 <= n)
      low = mid;
    else
      high = mid - 1;
  }
  n -= ((2 * H + low - 1) * low + (H + low) * (H + low + 1)) / 2;
  cout << 2 * low + H + (n + H + low - 1) / (H + low) << "\n";
  return 0;
}
