#include <bits/stdc++.h>
int main() {
  long long int n, k, x = 1, c = 0, v = 0, i;
  scanf("%lld%lld", &n, &k);
  for (i = 1; i <= n;) {
    if (c <= k) {
      c += x;
      i++;
      x++;
    } else {
      v += c - k;
      i += c - k;
      c = c - (c - k);
    }
  }
  printf("%lld\n", v);
}
