#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5, M = 12;
int main() {
  long long n, k;
  cin >> n >> k;
  long long x = n - (-3 + sqrt(9 + 8 * (n + k))) / (2);
  cout << x << endl;
}
