#include <bits/stdc++.h>
using namespace std;
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
long long n, h;
long long bSearch0(long long low, long long high) {
  long long mid = (low + high) >> 1;
  if (low <= high) {
    long long val = mid * (mid + 1LL) / 2LL;
    if (val > n)
      return bSearch0(low, mid - 1);
    else if (val == n)
      return mid;
    else
      return bSearch0(mid + 1, high);
  } else
    return mid;
}
long long bSearch1(long long low, long long high) {
  long long mid = (low + high) >> 1;
  if (low <= high) {
    long long val = (h + mid) * (h + mid + 1) - h * (h - 1) / 2LL;
    if (val > n)
      return bSearch1(low, mid - 1);
    else if (val == n)
      return mid;
    else
      return bSearch1(mid + 1, high);
  } else
    return mid;
}
long long bSearch2(long long low, long long high) {
  long long mid = (low + high) >> 1;
  if (low <= high) {
    long long val = (h + mid) * (h + mid + 1) - h * (h - 1) / 2LL - (h + mid);
    if (val > n)
      return bSearch2(low, mid - 1);
    else if (val == n)
      return mid;
    else
      return bSearch2(mid + 1, high);
  } else
    return mid;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n >> h;
  long long root = bSearch0(0LL, 2LL * 1000000007LL);
  if (root <= h) {
    if (root * (root + 1) / 2LL == n)
      cout << root << '\n';
    else
      cout << root + 1 << '\n';
  } else {
    root = bSearch1(0LL, 2LL * 1000000007LL);
    long long diff = n - ((h + root) * (h + root + 1) - h * (h - 1) / 2LL);
    if (!diff)
      cout << h + 2LL * root + 1 << '\n';
    else if (diff <= h + root + 1)
      cout << h + 2LL * root + 2 << '\n';
    else {
      root = bSearch2(0LL, 2LL * 1000000007LL);
      diff = n - ((h + root) * (h + root + 1) - h * (h - 1) / 2LL - (h + root));
      if (!diff)
        cout << h + 2LL * root << '\n';
      else
        cout << h + 2LL * root + 1 << '\n';
    }
  }
  return 0;
}
