#include <bits/stdc++.h>
using namespace std;
class A {
 public:
  void solve() {
    int n;
    cin >> n;
    vector<int> a(n / 2);
    for (int i = 0; i < n / 2; i++) cin >> a[i];
    sort(a.begin(), a.end());
    int res1 = 0, res2 = 0;
    int cnt = 0;
    for (int i = 1; i <= n; i += 2) {
      res1 += abs(a[cnt++] - i);
    }
    cnt = 0;
    for (int i = 2; i <= n; i += 2) {
      res2 += abs(a[cnt++] - i);
    }
    cout << min(res1, res2) << endl;
  }
};
class B {
 public:
  void solve() {
    int n, m;
    cin >> n >> m;
    vector<string> s(n);
    for (int i = 0; i < n; i++) cin >> s[i];
    vector<long long> cnt(m, 0);
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        cnt[j] += s[i][j] - '0';
      }
    }
    for (int i = 0; i < n; i++) {
      bool ok = true;
      for (int j = 0; j < m; j++) {
        if (s[i][j] == '0') continue;
        if (s[i][j] == '1' && cnt[j] == 1) {
          ok = false;
          break;
        }
      }
      if (ok) {
        cout << "YES" << endl;
        return;
      }
    }
    cout << "NO" << endl;
  }
};
class C {
 public:
  void solve() {
    long long n, k, l;
    cin >> n >> k >> l;
    long long m = n * k;
    vector<long long> a(m);
    for (int i = 0; i < m; i++) cin >> a[i];
    sort(a.begin(), a.end());
    int id = 0;
    for (int i = 1; i < m; i++) {
      if (a[i] - a[0] <= l) id = i;
    }
    if (id + 1 < n) {
      cout << 0 << endl;
      return;
    }
    long long res = a[0];
    n--;
    for (long long i = 0; id - n + 1 > i + k && n; i += k, n--) {
      res += a[i + k];
    }
    while (n--) res += a[id--];
    cout << res << endl;
  }
};
class D {
 public:
  void solve() {
    long long n, h;
    cin >> n >> h;
    long long l = 1, r = 2 * sqrt(n);
    long long ans = 0;
    auto check = [&n, &h](long long k) {
      long long res = 0;
      if (k <= h)
        res = (k * (k + 1) / 2);
      else {
        long long len = k - h - 1;
        res = h * (h + 1) / 2 + h;
        if (len & 1) {
          res += h + (len + 1) / 2;
        }
        len /= 2;
        res += 2 * len * h + len * (len + 1);
      }
      return n >= k && n <= res;
    };
    while (l <= r) {
      long long mid = l + (r - l) / 2;
      if (check(mid)) {
        ans = mid;
        r = mid - 1;
      } else
        l = mid + 1;
    }
    cout << ans << endl;
  }
};
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  D ans;
  ans.solve();
  return 0;
}
