#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k, n1 = 0, ans = 0, i = 1;
  cin >> n >> k;
  while (n--) {
    if (n1 < k)
      n1 += i++;
    else {
      n1--;
      ans++;
    }
  }
  cout << ans;
}
