#include <bits/stdc++.h>
using namespace std;
const double pi = 3.14159265358979323846264338327950;
const double M = pow(2, 32);
const long long int modinv = 5 * (pow(10, 8)) + 4;
struct Compare {
  constexpr bool operator()(pair<int, int> const& a,
                            pair<int, int> const& b) const noexcept {
    return (a.first > b.first) || (a.first == b.first && a.second > b.second);
  }
};
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long int n, k;
  cin >> n >> k;
  long long int l = 0, r = n;
  long long int ans = 0;
  long long int t = 10000;
  while (t--) {
    long long int m = l + (r - l) / 2;
    long long int temp = ((m) * (m + 1)) / 2 - (n - m);
    if (temp == k) {
      ans = m;
      break;
    } else {
      if (temp > k)
        r = m - 1;
      else
        l = m + 1;
    }
  }
  cout << n - ans << endl;
}
