#include <bits/stdc++.h>
using namespace std;
long long int n, k;
int func(long long int n, long long int k) {
  long long int g = 1, x = 0, cnt = 0;
  for (long long int i = n; i > 0; i--) {
    if (x <= k) {
      x = x + g;
      g++;
    } else {
      cnt += x - k;
      i -= (x - k);
      x = k;
    }
  }
  return cnt;
}
int main() {
  cin >> n >> k;
  cout << func(n, k);
}
