#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  long long int n, m;
  cin >> n >> m;
  if (n <= m)
    cout << n;
  else {
    long long int l = 0, r = 2e9, mid, v;
    while (l < r) {
      mid = l + ((r - l) / 2);
      v = (mid * (mid + 1)) / 2;
      if (v >= (n - m))
        r = mid;
      else
        l = mid + 1;
    }
    long long int ans = l + m;
    cout << ans;
  }
  return 0;
}
