#include <bits/stdc++.h>
using namespace std;
long long M = 1e9 + 7;
long long get_root(long long val) {
  long long low = 0, high = val;
  while (low <= high) {
    long long mid = (low + high) / ((long long)2);
    if (mid * mid == val) return mid;
    if (mid * mid < val)
      low = mid + 1;
    else
      high = mid - 1;
  }
  return 0;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long t;
  t = 1;
  while (t--) {
    long long n, k;
    cin >> n >> k;
    long long a = ((long long)2) * n + 3,
              b = sqrt(((long long)8) * n + ((long long)8) * k + (long long)9);
    long long fval = (a + b) / ((long long)2), sval = (a - b) / ((long long)2);
    if (fval <= (n - 1) && fval > 0) {
      cout << fval;
    } else {
      cout << sval;
    }
  }
  return 0;
}
