#include <bits/stdc++.h>
using namespace std;
template <typename... T>
void rd(T&... args) {
  ((cin >> args), ...);
}
template <typename... T>
void pp(T... args) {
  ((cout << args << " "), ...);
  cout << "\n";
}
void solve() {
  long long int S, N;
  rd(S, N);
  long long int C = S + N;
  long long int term = sqrt(9 + 8 * C);
  term -= 3;
  term /= 2;
  term = (term * (term + 1)) / 2 - N;
  pp(term);
  return;
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ;
  solve();
  return 0;
}
