#include <bits/stdc++.h>
using namespace std;
long long int func(long long int x, long long int n, long long int c) {
  return x * x + 3 * x - 2 * n - 2 * c;
}
int32_t main() {
  long long int n, k;
  cin >> n >> k;
  long long int lo = 0;
  long long int hi = 1000000000;
  long long int ans = 0;
  while (lo <= hi) {
    long long int mid = lo + (hi - lo) / 2;
    if (func(mid, n, k) >= 0) {
      ans = mid;
      hi = mid - 1;
    } else {
      lo = mid + 1;
    }
  }
  cout << (n - ans);
}
