#include <bits/stdc++.h>
using namespace std;
unsigned long long n, h;
bool check(unsigned long long maxh) {
  unsigned long long cnt = 0;
  if (maxh <= h) {
    cnt = (maxh + 1) * (maxh) / 2;
  } else {
    unsigned long long ele_num = maxh - h - 1;
    cnt += (1 + h) * h / 2 + h;
    if (ele_num % 2 == 1) {
      cnt +=
          (h + 1 + (h + (ele_num / 2))) * (ele_num / 2) + h + ele_num / 2 + 1;
    } else
      cnt += (h + 1 + (h + (ele_num / 2))) * (ele_num / 2);
  }
  return n <= cnt;
}
int main() {
  cin >> n >> h;
  unsigned long long l = 1, r = 20000000000 + 10;
  while (l < r - 1) {
    unsigned long long mid = (l + r) / 2;
    if (check(mid))
      r = mid;
    else
      l = mid;
  }
  cout << (check(l) ? l : r) << endl;
  return 0;
}
