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