#include <bits/stdc++.h>
using namespace std;
int main() {
  unsigned long long int n, k;
  cin >> n >> k;
  unsigned long long int i = 1, sum = 1;
  while ((sum - (n - i)) != k) {
    i++;
    sum = i * (i + 1) / 2;
  }
  cout << n - i << endl;
  return 0;
}
