#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long int n, k, ans = 0, fa = 0, c = 0;
  cin >> n >> k;
  c = (n * (n + 1)) / 2;
  c -= k;
  c -= n;
  while (c > 0) {
    fa++;
    c -= n;
    n--;
  }
  cout << fa;
  return 0;
}
