#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 7;
long long n, k;
int f[maxn];
int main() {
  while (cin >> n >> k) {
    long long x = sqrt(9 + 8 * (k + n)) / 2;
    cout << n - x + 1 << endl;
  }
  return 0;
}
