#include <bits/stdc++.h>
using namespace std;
using LL = long long;
using ULL = unsigned long long;
constexpr int INF = 2147483647;
constexpr int HINF = INF / 2;
constexpr double DINF = 100000000000000000.0;
constexpr double HDINF = 50000000000000000.0;
constexpr long long LINF = 9223372036854775807;
constexpr long long HLINF = 4500000000000000000;
const double PI = acos(-1);
template <typename T_char>
T_char TL(T_char cX) {
  return tolower(cX);
};
template <typename T_char>
T_char TU(T_char cX) {
  return toupper(cX);
};
const int vy[] = {-1, -1, -1, 0, 1, 1, 1, 0},
          vx[] = {-1, 0, 1, 1, 1, 0, -1, -1};
const int dx[4] = {0, 1, 0, -1}, dy[4] = {1, 0, -1, 0};
LL n, h;
int main() {
  cin >> n >> h;
  if (h > INF || n < h * (h + 1) / 2) {
    h = INF;
    LL left = 0, right = h + 1;
    while (right - left > 1) {
      LL mid = (left + right) / 2;
      LL num = mid * (mid + 1) / 2;
      if (num <= n)
        left = mid;
      else
        right = mid;
    }
    LL ans = left + (n - left * (left + 1) / 2 + left - 1) / left;
    cout << ans << endl;
  } else {
    LL left = h, right = INF;
    while (right - left > 1) {
      LL mid = (left + right) / 2;
      LL num = mid * (mid + 1) / 2 + (h + mid - 1) * (mid - h) / 2;
      if (num <= n)
        left = mid;
      else
        right = mid;
    }
    LL num2 = left * (left + 1) / 2 + (h + left - 1) * (left - h) / 2;
    LL ans = 2 * left - h + (n - num2 + left - 1) / left;
    cout << ans << endl;
  }
}
