#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, k;
  int ans = 0;
  cin >> n >> k;
  int op2 = 0, cnt = 0, candy = 1;
  while (true) {
    cnt += candy;
    candy++;
    op2++;
    if (cnt - (n - op2) == k) {
      cout << n - op2;
      return 0;
    }
  }
  return 0;
}
