#include <bits/stdc++.h>
using namespace std;
template <class T>
int check_mod(T a, T b) {
  return (a % b) ? 1 : 0;
}
void sieve(vector<char> &prime, int range) {
  prime.resize(range + 1, 1);
  prime[0] = prime[1] = 0;
  for (int i = 2; i * i <= range; i++)
    if (prime[i])
      for (int j = (i << 1); j <= range; j += i) prime[j] = 0;
  return;
}
void sieve(vector<char> &prime, vector<int> &prime_list, int range) {
  prime.resize(range + 1, 1);
  prime[0] = prime[1] = 0;
  for (int i = 2; i * i <= range; i++)
    if (prime[i]) {
      prime_list.push_back(i);
      for (int j = (i << 1); j <= range; j += i) prime[j] = 0;
    }
  return;
}
void sieve(vector<char> &prime, vector<long long> &prime_list, int range) {
  prime.resize(range + 1, 1);
  prime[0] = prime[1] = 0;
  for (long long i = 2; i * i <= range; i++)
    if (prime[i]) {
      prime_list.push_back(i);
      for (long long j = (i << 1); j <= (long long)range; j += i) prime[j] = 0;
    }
  return;
}
bool is_letter(char a) {
  if (('a' <= a && a <= 'z') || ('A' <= a && a <= 'Z')) return true;
  return false;
}
bool is_vowel(char a) {
  string vowels = "aeiouyAEIOUY";
  for (char c : vowels)
    if (c == a) return true;
  return false;
}
bool is_valid(int i, int j, int N, int M) {
  return 0 <= i && i < N && 0 <= j && j < M;
}
bool all_adjacents_valid(int i, int j, int N, int M) {
  for (int di = -1; di <= 1; di++)
    for (int dj = -1; dj <= 1; dj++)
      if (((di) * (di)) + ((dj) * (dj)) == 1 && !is_valid(i + di, j + dj, N, M))
        return false;
  return true;
}
bool is_prime(int a) {
  if (a == 2) return true;
  if (!(a & 1)) return false;
  for (int i = 3; i * i <= a; i += 2)
    if (!(a % i)) return false;
  return true;
}
bool is_prime(long long a) {
  if (a == 2) return true;
  if (!(a & 1)) return false;
  for (long long i = 3; i * i <= a; i += 2)
    if (!(a % i)) return false;
  return true;
}
bool is_palindrome(string s) {
  int len = (int)s.length();
  int mid = len >> 1;
  for (int i = 0; i < mid; i++)
    if (s[i] != s[len - i - 1]) return false;
  return true;
}
bool is_palindrome(vector<char> s) {
  int len = (int)s.size();
  int mid = len >> 1;
  for (int i = 0; i < mid; i++)
    if (s[i] != s[len - i - 1]) return false;
  return true;
}
int gcd(int a, int b) {
  while (b) {
    int mod = a % b;
    a = b;
    b = mod;
  }
  return a;
}
int lcm(int a, int b) { return a / gcd(a, b) * b; }
int binpow(int a, int b) {
  int res = 1;
  while (b) {
    if (b & 1) res *= a;
    a *= a;
    b >>= 1;
  }
  return res;
}
int binpow(int a, int b, int MODULO) {
  int res = 1;
  while (b) {
    if (b & 1) {
      res *= a;
      res %= MODULO;
    }
    a *= a;
    a %= MODULO;
    b >>= 1;
  }
  return res;
}
long long gcd(long long a, long long b) {
  while (b) {
    long long mod = a % b;
    a = b;
    b = mod;
  }
  return a;
}
long long lcm(long long a, long long b) { return a / gcd(a, b) * b; }
long long binpow(long long a, long long b) {
  long long res = 1;
  while (b) {
    if (b & 1) res *= a;
    a *= a;
    b >>= 1;
  }
  return res;
}
long long binpow(long long a, long long b, long long MODULO) {
  long long res = 1;
  while (b) {
    if (b & 1) {
      res *= a;
      res %= MODULO;
    }
    a *= a;
    a %= MODULO;
    b >>= 1;
  }
  return res;
}
double distance(int X1, int Y1, int X2, int Y2) {
  return sqrt(((X1 - X2) * (X1 - X2)) + ((Y1 - Y2) * (Y1 - Y2)));
}
double distance(long long X1, long long Y1, long long X2, long long Y2) {
  return sqrt(((X1 - X2) * (X1 - X2)) + ((Y1 - Y2) * (Y1 - Y2)));
}
double distance(double X1, double Y1, double X2, double Y2) {
  return sqrt(((X1 - X2) * (X1 - X2)) + ((Y1 - Y2) * (Y1 - Y2)));
}
string binary(int N) {
  if (!N) return "0";
  string bin = "";
  while (N) {
    bin += '0' + (N & 1);
    N >>= 1;
  }
  reverse((bin).begin(), (bin).end());
  return bin;
}
string binary(long long N) {
  if (!N) return "0";
  string bin = "";
  while (N) {
    bin += '0' + (N & 1);
    N >>= 1;
  }
  reverse((bin).begin(), (bin).end());
  return bin;
}
vector<char> binary_v(int N) {
  if (!N) return {'0'};
  vector<char> bin;
  while (N) {
    bin.push_back('0' + (N & 1));
    N >>= 1;
  }
  reverse((bin).begin(), (bin).end());
  return bin;
}
vector<char> binary_v(long long N) {
  if (!N) return {'0'};
  vector<char> bin;
  while (N) {
    bin.push_back('0' + (N & 1));
    N >>= 1;
  }
  reverse((bin).begin(), (bin).end());
  return bin;
}
const int INF = 2147483547;
const int MODULO = 1000000007;
const int _MODULO = 998244353;
const long long INF64 = 9223372036854775707;
const long long MODULO64 = 1000000007;
const long long _MODULO64 = 998244353;
const double epsilon = 10e-6;
const double PI = acos(-1);
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long N, k;
  cin >> N >> k;
  long long high = N;
  long long low = 0;
  while (low <= high) {
    long long mid = (low + high) / 2;
    if ((N - mid) * (N - mid + 1) / 2 > k + mid)
      low = mid + 1;
    else
      high = mid - 1;
  }
  cout << low << '\n';
  return 0;
}

### Prompt

Your task is to create a Cpp solution to the following problem:

Each evening after the dinner the SIS's students gather together to play the game of Sport Mafia. 

For the tournament, Alya puts candies into the box, which will serve as a prize for a winner. To do that, she performs n actions. The first action performed is to put a single candy into the box. For each of the remaining moves she can choose from two options:

  * the first option, in case the box contains at least one candy, is to take exactly one candy out and eat it. This way the number of candies in the box decreased by 1; 
  * the second option is to put candies in the box. In this case, Alya will put 1 more candy, than she put in the previous time. 



Thus, if the box is empty, then it can only use the second option.

For example, one possible sequence of Alya's actions look as follows:

  * put one candy into the box; 
  * put two candies into the box; 
  * eat one candy from the box; 
  * eat one candy from the box; 
  * put three candies into the box; 
  * eat one candy from the box; 
  * put four candies into the box; 
  * eat one candy from the box; 
  * put five candies into the box; 



This way she will perform 9 actions, the number of candies at the end will be 11, while Alya will eat 4 candies in total.

You know the total number of actions n and the number of candies at the end k. You need to find the total number of sweets Alya ate. That is the number of moves of the first option. It's guaranteed, that for the given n and k the answer always exists.

Please note, that during an action of the first option, Alya takes out and eats exactly one candy.

Input

The first line contains two integers n and k (1 ≤ n ≤ 10^9; 0 ≤ k ≤ 10^9) — the total number of moves and the number of candies in the box at the end. 

It's guaranteed, that for the given n and k the answer exists.

Output

Print a single integer — the number of candies, which Alya ate. Please note, that in this problem there aren't multiple possible answers — the answer is unique for any input data. 

Examples

Input


1 1


Output


0

Input


9 11


Output


4

Input


5 0


Output


3

Input


3 2


Output


1

Note

In the first example, Alya has made one move only. According to the statement, the first move is always putting one candy in the box. Hence Alya ate 0 candies.

In the second example the possible sequence of Alya's actions looks as follows: 

  * put 1 candy, 
  * put 2 candies, 
  * eat a candy, 
  * eat a candy, 
  * put 3 candies, 
  * eat a candy, 
  * put 4 candies, 
  * eat a candy, 
  * put 5 candies. 



This way, she will make exactly n=9 actions and in the end the box will contain 1+2-1-1+3-1+4-1+5=11 candies. The answer is 4, since she ate 4 candies in total.

### Response

```cpp
#include <bits/stdc++.h>
using namespace std;
template <class T>
int check_mod(T a, T b) {
  return (a % b) ? 1 : 0;
}
void sieve(vector<char> &prime, int range) {
  prime.resize(range + 1, 1);
  prime[0] = prime[1] = 0;
  for (int i = 2; i * i <= range; i++)
    if (prime[i])
      for (int j = (i << 1); j <= range; j += i) prime[j] = 0;
  return;
}
void sieve(vector<char> &prime, vector<int> &prime_list, int range) {
  prime.resize(range + 1, 1);
  prime[0] = prime[1] = 0;
  for (int i = 2; i * i <= range; i++)
    if (prime[i]) {
      prime_list.push_back(i);
      for (int j = (i << 1); j <= range; j += i) prime[j] = 0;
    }
  return;
}
void sieve(vector<char> &prime, vector<long long> &prime_list, int range) {
  prime.resize(range + 1, 1);
  prime[0] = prime[1] = 0;
  for (long long i = 2; i * i <= range; i++)
    if (prime[i]) {
      prime_list.push_back(i);
      for (long long j = (i << 1); j <= (long long)range; j += i) prime[j] = 0;
    }
  return;
}
bool is_letter(char a) {
  if (('a' <= a && a <= 'z') || ('A' <= a && a <= 'Z')) return true;
  return false;
}
bool is_vowel(char a) {
  string vowels = "aeiouyAEIOUY";
  for (char c : vowels)
    if (c == a) return true;
  return false;
}
bool is_valid(int i, int j, int N, int M) {
  return 0 <= i && i < N && 0 <= j && j < M;
}
bool all_adjacents_valid(int i, int j, int N, int M) {
  for (int di = -1; di <= 1; di++)
    for (int dj = -1; dj <= 1; dj++)
      if (((di) * (di)) + ((dj) * (dj)) == 1 && !is_valid(i + di, j + dj, N, M))
        return false;
  return true;
}
bool is_prime(int a) {
  if (a == 2) return true;
  if (!(a & 1)) return false;
  for (int i = 3; i * i <= a; i += 2)
    if (!(a % i)) return false;
  return true;
}
bool is_prime(long long a) {
  if (a == 2) return true;
  if (!(a & 1)) return false;
  for (long long i = 3; i * i <= a; i += 2)
    if (!(a % i)) return false;
  return true;
}
bool is_palindrome(string s) {
  int len = (int)s.length();
  int mid = len >> 1;
  for (int i = 0; i < mid; i++)
    if (s[i] != s[len - i - 1]) return false;
  return true;
}
bool is_palindrome(vector<char> s) {
  int len = (int)s.size();
  int mid = len >> 1;
  for (int i = 0; i < mid; i++)
    if (s[i] != s[len - i - 1]) return false;
  return true;
}
int gcd(int a, int b) {
  while (b) {
    int mod = a % b;
    a = b;
    b = mod;
  }
  return a;
}
int lcm(int a, int b) { return a / gcd(a, b) * b; }
int binpow(int a, int b) {
  int res = 1;
  while (b) {
    if (b & 1) res *= a;
    a *= a;
    b >>= 1;
  }
  return res;
}
int binpow(int a, int b, int MODULO) {
  int res = 1;
  while (b) {
    if (b & 1) {
      res *= a;
      res %= MODULO;
    }
    a *= a;
    a %= MODULO;
    b >>= 1;
  }
  return res;
}
long long gcd(long long a, long long b) {
  while (b) {
    long long mod = a % b;
    a = b;
    b = mod;
  }
  return a;
}
long long lcm(long long a, long long b) { return a / gcd(a, b) * b; }
long long binpow(long long a, long long b) {
  long long res = 1;
  while (b) {
    if (b & 1) res *= a;
    a *= a;
    b >>= 1;
  }
  return res;
}
long long binpow(long long a, long long b, long long MODULO) {
  long long res = 1;
  while (b) {
    if (b & 1) {
      res *= a;
      res %= MODULO;
    }
    a *= a;
    a %= MODULO;
    b >>= 1;
  }
  return res;
}
double distance(int X1, int Y1, int X2, int Y2) {
  return sqrt(((X1 - X2) * (X1 - X2)) + ((Y1 - Y2) * (Y1 - Y2)));
}
double distance(long long X1, long long Y1, long long X2, long long Y2) {
  return sqrt(((X1 - X2) * (X1 - X2)) + ((Y1 - Y2) * (Y1 - Y2)));
}
double distance(double X1, double Y1, double X2, double Y2) {
  return sqrt(((X1 - X2) * (X1 - X2)) + ((Y1 - Y2) * (Y1 - Y2)));
}
string binary(int N) {
  if (!N) return "0";
  string bin = "";
  while (N) {
    bin += '0' + (N & 1);
    N >>= 1;
  }
  reverse((bin).begin(), (bin).end());
  return bin;
}
string binary(long long N) {
  if (!N) return "0";
  string bin = "";
  while (N) {
    bin += '0' + (N & 1);
    N >>= 1;
  }
  reverse((bin).begin(), (bin).end());
  return bin;
}
vector<char> binary_v(int N) {
  if (!N) return {'0'};
  vector<char> bin;
  while (N) {
    bin.push_back('0' + (N & 1));
    N >>= 1;
  }
  reverse((bin).begin(), (bin).end());
  return bin;
}
vector<char> binary_v(long long N) {
  if (!N) return {'0'};
  vector<char> bin;
  while (N) {
    bin.push_back('0' + (N & 1));
    N >>= 1;
  }
  reverse((bin).begin(), (bin).end());
  return bin;
}
const int INF = 2147483547;
const int MODULO = 1000000007;
const int _MODULO = 998244353;
const long long INF64 = 9223372036854775707;
const long long MODULO64 = 1000000007;
const long long _MODULO64 = 998244353;
const double epsilon = 10e-6;
const double PI = acos(-1);
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long N, k;
  cin >> N >> k;
  long long high = N;
  long long low = 0;
  while (low <= high) {
    long long mid = (low + high) / 2;
    if ((N - mid) * (N - mid + 1) / 2 > k + mid)
      low = mid + 1;
    else
      high = mid - 1;
  }
  cout << low << '\n';
  return 0;
}

```