#include <bits/stdc++.h>
using namespace std;
long long N, H, Ans;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> N >> H;
  if (H <= (long long)2e9 && N >= H * (H + 1) / 2) {
    long long Lo = H, Hi = (long long)2e9;
    while (Lo + 1 < Hi) {
      long long Md = (Lo + Hi) / 2;
      long long A = Md * Md - (H - 1) * H / 2;
      if (A > N)
        Hi = Md;
      else
        Lo = Md;
    }
    long long A = Lo * Lo - (H - 1) * H / 2;
    long long R = N - A;
    Ans = Lo - H + Lo;
    if (R > 0) Ans++;
    if (R > Lo) Ans++;
  } else {
    long long Lo = 1LL, Hi = min(H + 1, (long long)2e9);
    while (Lo + 1 < Hi) {
      long long Md = (Lo + Hi) / 2;
      if (Md * (Md + 1) / 2 > N)
        Hi = Md;
      else
        Lo = Md;
    }
    long long L = Lo * (Lo + 1) / 2;
    long long R = N - L;
    Ans = (R == 0) ? Lo : Lo + 1;
  }
  cout << Ans << '\n';
  return 0;
}
