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