#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
string str;
int main() {
  double n, k;
  scanf("%lf%lf", &n, &k);
  double ans = sqrt(2.25 + 2 * (n + k)) - 1.5;
  ans = n - ans;
  printf("%.0f\n", ans);
  return 0;
}
