#include <bits/stdc++.h>
using namespace std;
long long n, h;
const long long cnt = 2000000000;
bool check(long long x) {
  if (x <= h) {
    if (x >= cnt) return true;
    return x * (x + 1) / 2 >= n;
  }
  long long a = (x - h) / 2 + h;
  if (a >= cnt) return true;
  if ((x - h) % 2 != 0) return a * (a + 1) / 2 + (a + h) * (a + 1 - h) / 2 >= n;
  return a * (a + 1) / 2 + (a - 1 + h) * (a - h) / 2 >= n;
}
int main() {
  cin >> n >> h;
  long long ln = 1, rn = n;
  while (ln <= rn) {
    long long mid = (ln + rn) >> 1ll;
    if (check(mid))
      rn = mid - 1;
    else
      ln = mid + 1;
  }
  cout << rn + 1 << endl;
}
