#include <bits/stdc++.h>
using namespace std;
long long check(long long n, long long k) { return (2ll * n / k) >= (k + 1); }
void solve1(long long n, long long h) {
  long long l = 1, r = h, ans = 0;
  while (l <= r) {
    long long mid = (l + r) >> 1;
    if (check(n, mid))
      ans = mid, l = mid + 1;
    else
      r = mid - 1;
  }
  n -= ans * (ans + 1) / 2;
  if (n == 0)
    cout << ans << "\n";
  else
    cout << ans + (n / ans) + (n % ans != 0) << "\n";
}
bool check2(long long n, long long k, long long h) {
  if (2 * n / k < (k + 1)) return false;
  n -= k * (k + 1) / 2;
  long long a = h + k - 1, b = k - h;
  if ((2 * n) / a < b) return false;
  return true;
}
void solve2(long long n, long long h) {
  long long l = h, r = n, ans = 0;
  while (l <= r) {
    long long mid = (l + r) >> 1;
    if (check2(n, mid, h))
      ans = mid, l = mid + 1;
    else
      r = mid - 1;
  }
  n -= ans * (ans + 1) / 2;
  long long a = h + ans - 1, b = ans - h;
  n -= a * b / 2;
  cout << ans + ans - h + (n / ans) + (n % ans != 0) << "\n";
}
int main() {
  long long n, h;
  cin >> n >> h;
  if (2 * n / (h + 1) <= (h + 2))
    solve1(n, h);
  else
    solve2(n, h);
  return 0;
}
