#include <bits/stdc++.h>
using namespace std;
signed main() {
  cin.tie(0), cout.tie(0), ios::sync_with_stdio(0);
  long long n, k;
  cin >> n >> k;
  long long ans = (sqrt(9 + 8 * (n + k)) - 3) / 2;
  cout << n - ans << endl;
  return 0;
}
