#include <bits/stdc++.h>
int main() {
  long long int n, k, i = 1, tot = 0, eat = 0;
  scanf("%lld %lld", &n, &k);
  while (n != 0) {
    if (tot > k) {
      eat++;
      tot--;
    } else {
      tot = tot + i;
      i++;
    }
    n--;
  }
  printf("%d", eat);
}
