#include <bits/stdc++.h>
using namespace std;
using namespace std;
void Draganov47() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
long long solve(long long k, long long h1) {
  return (k * k) - (h1 * (h1 - 1)) / 2;
}
int main() {
  Draganov47();
  long long n, H;
  cin >> n >> H;
  long long l = 1, r = 2000000000LL + 1;
  while (l + 1 < r) {
    long long m = (l + r) >> 1;
    long long val = solve(m, min(H, m));
    if (val <= n)
      l = m;
    else
      r = m;
  }
  long long ans = 2 * l - 1;
  if (l <= H)
    ans = l;
  else
    ans -= (H - 1);
  long long ost = n - solve(l, min(l, H));
  if (ost) ans += (ost - 1) / l + 1;
  cout << ans;
  return 0;
}
