#include <bits/stdc++.h>
const int Mod(1000000007);
const int MAXN(2000005);
using namespace std;
int arr[MAXN], cnt[MAXN];
int main() {
  int64_t n, m, k;
  cin >> n >> k;
  int64_t dert = 9 + 8 * (n + k);
  dert = (int64_t)sqrt(dert);
  cout << n - ((dert - 3) / 2) << endl;
  return 0;
}
