#include <bits/stdc++.h>
using namespace std;
long long n, h;
long long check(long long id) { return id * (id + 1) / (2ll); }
long long cal(long long id) {
  if (id & 1) {
    long long num1 = id / 2;
    long long num2 = 2ll * check(num1);
    return num2 + id * h;
  } else {
    long long num1 = id / 2;
    return num1 * num1 + id * h;
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> h;
  long long num = sqrt(2ll * n);
  if (num < 1) num = 1;
  while (check(num) > n) num--;
  num = max(num, 0ll);
  while (check(num + 1) <= n) num++;
  if (num < 0) num = 0;
  if (num <= h) {
    if (check(num) == n)
      cout << num << endl;
    else
      cout << num + 1 << endl;
    return 0;
  }
  long long l = 0;
  long long r = INT_MAX;
  while (l <= r) {
    long long mid = (l + r) >> 1;
    long long val = cal(mid);
    if (val > n - check(h))
      r = mid - 1;
    else
      l = mid + 1;
  }
  long long mid = (l + r) >> 1;
  long long num1 = n - check(h);
  long long num2 = num1 - cal(mid);
  cout << h + mid + (num2 && 1) << endl;
}
