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 \le n \le 10^9$; $0 \le k \le 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.

Difficulty: interview

Starter code:

Solutions:
n,k=map(int,input().split())
low=1
high=n
import sys
while low<=high:
    mid=(low+high)//2
    if mid*(mid+1)//2 -(n-mid)>k:
        high=mid-1
    elif mid*(mid+1)//2-(n-mid)==k:
        print(n-mid)
        return
    else :
        low=mid+1

def main():
    import sys
    input = sys.stdin.readline
    
    n, k = map(int, input().split())
    
    l = 1
    r = n + 1
    
    while r - l != 1:
        m = l + r >> 1
        candies = m * (m + 1) // 2
        eat = n - m
        
        if candies - eat <= k:
            l = m
        else:
            r = m
    
    print(n - l)
    
    return 0

main()

turns, candies = map(int, input().split())
summ = 0
turn = 0
while candies != summ - (turns - turn):
    turn += 1
    summ += turn
print(turns - turn)

#n = int(input())
n,k = map(int,input().split())

current = 1
actions = 1
step = 2
while n!= (actions + (current-k)):
    current += step
    step+=1
    actions +=1

print (current-k)

n, k = list(map(int, input().split()))
c = 1
while c * (c + 1) // 2 < k:
    c += 1
while c * (c + 1) // 2 - (n - c) != k:
    c += 1
print(n - c)


a, b = list(map(int,input().split()))
l = 0
r = a + 1
while r - l > 1:
    m = (r + l) // 2
    #print(l, r)
    if m * (m + 1) // 2 - (a - m) > b:
        r = m
    else:
        l = m
print(a - l)

n, k = map(int, input().split())
l = 0
r = n + 1
while r - l > 1:
    m = (l + r) // 2
    if m * (m + 1) // 2 - (n - m) > k:
        r = m
    else:
        l = m
print(n - l)

from math import sqrt as sqrt
n, k = map(int, input().split())
t = int(sqrt(8 * n + 8 * k + 9) + 0.0001)
m = (t - 3) // 2
print(n - m)

n, k = list(map(int, input().split()))
c = n + k
p = int(0.5 * ((8 * c + 9) ** 0.5 - 3))
print(n - p)


n, k = [int(i) for i in input().split()]
for i in range(100*k+100*n):
    if i*(i+1) == (n+k-i)*2:
        print(n-i)
        break

N, K = list(map(int,input().split()))
B = (-2 * N - 3)
C = (N * N + N - 2 * K)

def sqr(n):
    x = n
    y = (x + 1) // 2
    while y < x:
        x = y
        y = (x + n // x) // 2
    return x

t = sqr(B*B-4*C)
print((-B - t)//2)


from collections import Counter

n, k = list(map(int, input().split()))

for p in range(n+1):
    if p*(p+1)//2 - (n-p) == k:
        print(n-p)
        break


from math import *
n,k=list(map(int,input().split()))
val=int(sqrt(9+(8*(n+k))))
ans=(-3+val)//2
print(n-ans)


#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import time


(n, k) = (int(i) for i in input().split())


start = time.time()

print((2*n+3-int((9+8*(n+k))**0.5))//2)
finish = time.time()
#print(finish - start)


import sys
import math

n, k = list(map(int, sys.stdin.readline().strip().split()))
a = (2 * n + 3 - math.sqrt((2*n+3)**2 - 4 * (n**2 + n - 2 * k))) // 2
print(int(a))

n,k=map(int,input().split())
for i in range(10**5):
  if (i*(i+1))//2-(n-i)==k:
    print(n-i)

import math
n,k = [int(x) for x in input().split(' ')]
ans = ((2*n + 3) - int(math.sqrt(8*n + 8*k + 9)))//2
print(ans);

n, k = map(int, input().split())
d = int((9 + 8 * (n + k)) ** 0.5)
x = (d - 3) // 2
print(n - x)

import sys
input = sys.stdin.readline
sys.setrecursionlimit(100000)

def getN():
    return int(input())
def getList():
    return list(map(int, input().split()))
import math

def validation(n, k, x):
    if (x*(x+1)) // 2 - (n-x) == k:
        return 0
    if (x * (x + 1)) // 2 - (n - x) > k:
        return 1
    return 2

n, k = getList()

l = 0
r = 1000000001
while(True):
    mid = (l+r)//2
    flag = validation(n, k, mid)
    if flag == 0:
        ans = mid
        break
    elif flag == 1:
        r = mid
    else:
        l = mid

print(n - ans)


from math import sqrt
n, k = list(map(int, input().split()))
print(int(n - 0.5 * (sqrt(8 * (k + n) + 9) - 3)))


import math
n, k = map(int, input().split())

q = int(-3 + math.sqrt(9 + 8*(n+k)))//2

r = n-q

print(r)

n,k=[int(i) for i in input().split()]
a = pow(1+2*k+2*n,0.5) - 1
print(n-int(a))


from sys import stdin, stdout, exit
import math

n, k = list(map(int, stdin.readline().split()))



ans = round((-3 + math.sqrt(9 + 8*(k+n))) / 2)
stdout.write(str(n-ans) + "\n")


import sys

def input():
    return sys.stdin.readline().strip()

def dinput():
    return int(input())

def tinput():
    return input().split()

def rinput():
    return map(int, tinput())

def rt(x1, x2, y3):
    print(0.5 * (x2 + x1) * y3)

def main():
    n, k = rinput()
    i = 0
    t = 0
    while k > i:
        t += 1
        i += t
    c = n - t
    i -= c
    while i != k:
        t += 1
        i += t + 1
        c -= 1
    print(c)
main()