#include <bits/stdc++.h>
using namespace std;
int dirx[8] = {0, 0, 1, -1, 1, 1, -1, -1};
int diry[8] = {1, -1, 0, 0, 1, -1, 1, -1};
int knightx[] = {2, 2, -2, -2, 1, 1, -1, -1};
int knighty[] = {1, -1, 1, -1, 2, -2, 2, -2};
template <class T>
inline bool fastread(T &x) {
  int c = getchar();
  int sgn = 1;
  while (~c && c < '0' || c > '9') {
    if (c == '-') sgn = -1;
    c = getchar();
  }
  for (x = 0; ~c && '0' <= c && c <= '9'; c = getchar()) x = x * 10 + c - '0';
  x *= sgn;
  return ~c;
}
long long bs(long long n, long long k) {
  long long bg = 1, ed = n, mid, ans = -1;
  while (bg <= ed) {
    mid = (bg + ed) >> 1;
    long long x = (mid * (mid + 1)) >> 1;
    long long xx = n - mid;
    long long rem = x - xx;
    if (rem == k) return xx;
    if (rem > k) {
      ed = mid - 1;
    } else
      bg = mid + 1;
  }
  return bg;
}
int main() {
  long long n, k;
  cin >> n >> k;
  cout << bs(n, k) << endl;
}
