#include <bits/stdc++.h>
using namespace std;
long long int fastPower(long long int a, long long int b) {
  long long int res = 1;
  a = a % 1000000007;
  if (a == 0) return 0;
  while (b > 0) {
    if (b & 1) res = (res * a) % 1000000007;
    b = b >> 1;
    a = (a * a) % 1000000007;
  }
  return res;
}
unordered_map<char, int> symbol = {{'[', -1}, {'(', -2}, {'{', -3},
                                   {']', 1},  {')', 2},  {'}', 3}};
bool isBalanced(string s) {
  stack<char> st;
  for (char bracket : s) {
    if (symbol[bracket] < 0) {
      st.push(bracket);
    } else {
      if (st.empty()) {
        return false;
      }
      char top = st.top();
      st.pop();
      if (symbol[top] + symbol[bracket] != 0) return false;
    }
  }
  if (st.empty())
    return true;
  else
    return false;
}
int gcd(int a, int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long int C(long long int n, long long int k) {
  long long int ans = 1;
  if (k > n - k) k = n - k;
  for (long long int i = 1; i <= k; i++) {
    ans = ans * ((n - i + 1));
    ans = ans / i;
  }
  return ans;
}
void solve() {
  long long int n, k;
  cin >> n >> k;
  long long int sum = (n * (n + 1)) / 2;
  long long int i = 1;
  while ((i * (i + 1) / 2) - (n - i) != k) {
    i++;
  }
  cout << (n - i) << endl;
}
int main() {
  int t;
  t = 1;
  while (t--) {
    solve();
  }
}
