#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e18 + 10;
long long maxBall(long long H, long long k) {
  if (k < H) return k < 2e9 ? k * (k + 1) / 2 : INF;
  if (H > 2e9) return INF;
  k -= H - 1;
  long long x = k / 2 + H - !(k % 2);
  return x < 2e9 ? x * (x + 1 - (k % 2)) - H * (H - 1) / 2 : INF;
}
int32_t main() {
  ios_base ::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  long long n, H;
  cin >> n >> H;
  long long L = 0, R = n;
  while (L + 1 < R) {
    long long mid = (L + R) / 2;
    maxBall(H, mid) < n ? L = mid : R = mid;
  }
  cout << R << endl;
  return 0;
}
