#include <bits/stdc++.h>
using namespace std;
template <class T1, class T2>
ostream &operator<<(ostream &os, const pair<T1, T2> &p) {
  os << "{" << p.first << "," << p.second << "}";
  return os;
}
const int N = 3e5 + 5;
const int oo = 1e9 + 7;
bool pos(long long n, long long h, long long d) {
  long long x = max(0LL, 1 + (d - h) / 2);
  long long tot = h * x + (x) * (x - 1) / 2;
  x = d - x;
  tot += x * (x + 1) / 2;
  return tot >= n;
}
int32_t main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  long long n, h;
  cin >> n >> h;
  long long lo = 1, hi = 2e9, mid;
  assert(pos(n, h, hi));
  while (lo < hi) {
    mid = lo + (hi - lo) / 2;
    if (pos(n, h, mid))
      hi = mid;
    else
      lo = mid + 1;
  }
  cout << hi << "\n";
}
