#include <bits/stdc++.h>
using namespace std;
long long f(long long a, long long b) {
  return (b * (b + 1) - a * (a - 1)) / 2;
}
long long n, h;
int main() {
  cin >> n >> h;
  long long b = 0, e = 2e9 + 3;
  h = min(h, e);
  while (e - b > 1) {
    long long mid = (b + e) >> 1;
    long long k = 0;
    if (mid <= h)
      k = f(1, mid);
    else if (mid % 2 == h % 2) {
      long long t = (mid + h) / 2;
      k = f(1, t) + f(h, t - 1);
    } else {
      long long t = (mid + h) / 2;
      k = f(1, t) + f(h, t);
    }
    if (k >= n)
      e = mid;
    else
      b = mid;
  }
  cout << e << '\n';
  return 0;
}
