#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, k;
  cin >> n >> k;
  long long l = -1, r = n + 1;
  while (r - l > 1) {
    long long mid = (l + r) / 2;
    if ((n - mid) * (n - mid + 1) / 2 - mid > k)
      l = mid;
    else
      r = mid;
  }
  std::cout << r;
  return 0;
}
