#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  double n = 9, k = 11;
  cin >> n >> k;
  cout << static_cast<long long>(round((n + 1.5) - sqrt(2 * k + 2 * n + 2.75)));
  return 0;
}
