#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n;
  long long int k;
  cin >> n >> k;
  int m = sqrt((n + n + 1 + 2) * (n + n + 1 + 2) - 4 * ((n + 1) * n - 2 * k));
  if ((n * (n + 1) + 2 + m) / 2 >= 0 && (n * (n + 1) + 2 + m) / 2 <= n)
    cout << (n + n + 1 + 2 + m) / 2 << endl;
  else
    cout << (n + n + 1 + 2 - m) / 2 << endl;
  return 0;
}
