#include <bits/stdc++.h>
using namespace std;
long long n, k;
int main() {
  while (cin >> n >> k) {
    long long r1 = ((2 * n + 3) +
                    sqrt((2 * n + 3) * (2 * n + 3) - 4 * (n * n + n - 2 * k))) /
                   2;
    long long r2 = ((2 * n + 3) -
                    sqrt((2 * n + 3) * (2 * n + 3) - 4 * (n * n + n - 2 * k))) /
                   2;
    if (r1 >= 0 && r1 <= n) {
      cout << r1 << endl;
    } else {
      cout << r2 << endl;
    }
  }
}
