#include <bits/stdc++.h>
using namespace std;
long long i, n, k;
int main() {
  cin >> n >> k;
  i = 1;
  while (1) {
    k -= i;
    i++;
    n--;
    if (k <= 0 && n == abs(k)) {
      cout << n;
      exit(0);
    }
  }
}
