#include <bits/stdc++.h>
using namespace std;
const long long inf = 1e18;
const long long mod = 1e9 + 7;
long long n, h;
long long search1(long long start, long long end) {
  if (start == end) return start;
  long long mid = (start + end) / 2;
  long long x = mid * (mid + 1) / 2;
  if (n <= x)
    return search1(start, mid);
  else
    return search1(mid + 1, end);
}
long long search2(long long start, long long end) {
  if (start == end) {
    if (n > (h + start) * (h + start) - h * (h - 1) / 2 - h - start)
      return (h + 2 * start);
    else
      return (h + 2 * start - 1);
  }
  long long mid = (start + end) / 2;
  long long x = (h + mid) * (h + mid) - h * (h - 1) / 2;
  if (n <= x)
    return search2(start, mid);
  else
    return search2(mid + 1, end);
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> h;
  if (h >= 2e9 || n <= h * (h + 1) / 2)
    cout << search1(1, 2e9);
  else
    cout << search2(1, 2e9);
}
