#include <bits/stdc++.h>
using namespace std;
class Solution {
 public:
  long long count(long long n, long long H) {
    long long res = 0;
    long long l = 1;
    long long r = n;
    long long limit = sqrt(3LL * 1e18);
    while (l < r) {
      long long m = l + (r - l) / 2;
      long long cnt = 0;
      if (m <= H) {
        if (m >= limit) {
          r = m;
          continue;
        }
        cnt = m * (m + 1) / 2;
      } else {
        long long p = H + (m - H) / 2;
        if (p >= limit) {
          r = m;
          continue;
        }
        if (p * (p + 1) / 2 > n) {
          r = m;
          continue;
        }
        long double pr = m - p;
        pr *= H;
        if (pr >= n) {
          r = m;
          continue;
        }
        pr += (m - p) * (m - p - 1) / 2;
        if (pr >= n) {
          r = m;
          continue;
        }
        cnt = p * (p + 1) / 2 + (m - p) * H + (m - p) * (m - p - 1) / 2;
      }
      if (cnt >= n) {
        r = m;
      } else {
        l = m + 1;
      }
    }
    return l;
  }
};
int main(int argc, char** argv) {
  long long n, h;
  scanf("%llu%llu", &n, &h);
  Solution sol;
  printf("%llu\n", sol.count(n, h));
  return 0;
}
