#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  long long n, i, j, k;
  cin >> n >> k;
  if (n <= k) {
    cout << n << endl;
    return 0;
  }
  long long ans = k;
  long long lo = 0, hi = 4e9, mid, r, t = 100;
  n = n - k;
  while (t--) {
    mid = (lo + hi) / 2;
    long long x = (mid * (mid + 1)) / 2;
    if (x < n)
      lo = mid + 1;
    else {
      r = mid;
      hi = mid - 1;
    }
  }
  cout << ans + r << endl;
  return 0;
}
