#include <bits/stdc++.h>
using namespace std;
const int dx[] = {-1, -1, -1, 0, 0, 0, 1, 1, 1};
const int dy[] = {-1, 0, 1, -1, 0, 1, -1, 0, 1};
void fast() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
}
long long gcd(long long a, long long b) { return !b ? a : gcd(b, a % b); }
long long lcm(long long a, long long b) { return a / gcd(a, b) * b; }
int n, k;
double can(int x) {
  double z = x + k;
  double u = (-1 + sqrt(1 + 4 * z * 2)) / 2.0;
  return u + x;
}
int main() {
  fast();
  cin >> n >> k;
  int l = 0, r = 2e9, ans;
  while (l <= r) {
    long long mid = (l + r) / 2;
    if (can(mid) == n) {
      ans = mid;
      break;
    } else if (can(mid) < n)
      l = mid + 1;
    else
      r = mid - 1;
  }
  cout << ans;
  return 0;
}
