#include <bits/stdc++.h>
const int MAXN = 100000;
int a[MAXN + 10];
using namespace std;
int main() {
  long long n, h;
  cin >> n >> h;
  long long ans = (sqrt(1LL + 8LL * n) - 1LL) / 2LL;
  if (ans <= h) {
    if ((ans * (ans + 1LL) / 2LL) < n) ans++;
    cout << ans << endl;
    return 0;
  }
  ans = (sqrt(1LL + 4LL * n + 2LL * h * (h - 1LL)) - 1) / 2LL;
  if ((ans * (ans + 1LL) / 2LL) + ((ans + h) * (ans - h + 1) / 2LL) < n) ans++;
  long long tans = ans + ans - h + 1;
  if ((ans * (ans + 1LL) / 2LL) + ((ans + h) * (ans - h + 1) / 2LL) - n >= ans)
    tans--;
  cout << tans << endl;
}
