#include <bits/stdc++.h>
using namespace std;
int n, k, sum = 0;
int main() {
  cin >> n >> k;
  int qq = n;
  for (int i = 1; i <= n; i++) {
    sum = sum + i;
    qq--;
    if (sum - qq == k) break;
  }
  cout << qq;
  return 0;
}
