#include <bits/stdc++.h>
using namespace std;
const long long int sz = 100005;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long int t = 1;
  while (t--) {
    long long int n, k;
    cin >> n >> k;
    if (n == 1) {
      cout << "0";
      return 0;
    }
    long long int val = ((long long int)sqrt(9 + 8 * (n + k)) - 3LL) / 2LL;
    cout << n - val << "\n";
    ;
  }
}
