#include <bits/stdc++.h>
using namespace std;
const int64_t MOD = 1000000007;
int64_t power(int64_t a, int64_t b, int64_t p) {
  int64_t ans = 1;
  while (b) {
    if (b & 1) {
      ans = (ans * a) % p;
    }
    a = (a * a) % p;
    b >>= 1;
  }
  return ans;
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int64_t n, k, a, b;
  cin >> k >> n;
  a = (2 * k + 3 + sqrt(8 * k + 8 * n + 9)) / 2;
  b = (2 * k + 3 - sqrt(8 * k + 8 * n + 9)) / 2;
  if (a >= 0 && a < k)
    cout << a << endl;
  else
    cout << b << endl;
  return 0;
}
