#include <bits/stdc++.h>
long long n, h;
const long long www = 2000000000;
bool check(long long mid) {
  if (mid <= h) {
    if (mid >= www) return 1;
    long long sum = mid * (mid + 1) / 2;
    if (sum >= n)
      return 1;
    else
      return 0;
  }
  long long x = (mid - h) / 2 + h;
  if (x >= www) return 1;
  if ((mid - h) % 2 != 0) {
    long long sum = x * (x + 1) / 2 + (x + h) * (x + 1 - h) / 2;
    if (sum >= n)
      return 1;
    else
      return 0;
  } else {
    long long sum = x * (x + 1) / 2 + (x - 1 + h) * (x - h) / 2;
    if (sum >= n) return 1;
    return 0;
  }
  return 1;
}
using namespace std;
int main() {
  cin >> n >> h;
  long long l = 1, r = n;
  long long mid;
  while (l <= r) {
    mid = (l + r) >> 1ll;
    if (check(mid))
      r = mid - 1;
    else
      l = mid + 1;
  }
  cout << r + 1 << endl;
}
