#include <bits/stdc++.h>
using namespace std;
int main() {
  long n, k;
  cin >> n >> k;
  long ate = n;
  long gave = 0;
  long p = 1;
  long ans = -n;
  while (ans != k) {
    ate--;
    gave += p;
    p++;
    ans = gave - ate;
  }
  cout << ate;
}
