#include <bits/stdc++.h>
using namespace std;
long long n, h;
bool check(long long len) {
  long long area;
  if (len <= h)
    area = (1 + len) * (abs(len - 1) + 1) / 2;
  else {
    area = (1 + h - 1) * (abs(h - 1 - 1) + 1) / 2;
    len -= h;
    if (len % 2)
      area = area + (h + h + len / 2) * (abs(h + len / 2 - h) + 1) / 2 +
             (h + len / 2 + h) * (abs(h - h + len / 2) + 1) / 2;
    else
      area = area + (h + h + len / 2) * (abs(h + len / 2 - h) + 1) / 2 +
             (h + len / 2 - 1 + h) * (abs(h - h + len / 2 - 1) + 1) / 2;
  }
  if (area >= n)
    return true;
  else
    return false;
}
long long bi_search(long long l, long long r) {
  l--, r++;
  long long m;
  while (l + 1 < r) {
    m = (l + r) / 2;
    if (check(m) == false)
      l = m;
    else
      r = m;
  }
  return r;
}
int main() {
  std::ios::sync_with_stdio(false);
  cin.tie(0);
  while (cin >> n >> h) {
    long long r = 2 * sqrt(n) + 1;
    long long ans = bi_search(1, r);
    cout << ans << endl;
  }
  return 0;
}
