Problem:
 Score : 200 points    Problem Statement In some village, there are 999 towers that are 1,(1+2),(1+2+3),...,(1+2+3+...+999) meters high from west to east, at intervals of 1 meter.  It had been snowing for a while before it finally stopped. For some two adjacent towers located 1 meter apart, we measured the lengths of the parts of those towers that are not covered with snow, and the results are a meters for the west tower, and b meters for the east tower.  Assuming that the depth of snow cover and the altitude are the same everywhere in the village, find the amount of the snow cover.  Assume also that the depth of the snow cover is always at least 1 meter.      Constraints  1 \leq a < b < 499500(=1+2+3+...+999)  All values in input are integers.  There is no input that contradicts the assumption.         Input Input is given from Standard Input in the following format:  a  b       Output If the depth of the snow cover is x meters, print x as an integer.        Sample Input 1 8 13      Sample Output 1 2  The heights of the two towers are 10 meters and 15 meters, respectively.
Thus, we can see that the depth of the snow cover is 2 meters.       Sample Input 2 54 65      Sample Output 2 1

Solution (Python):
a, b = map(int, input().split())
total = 0
for i in range(1, (b - a) + 1):
    total += i
print(total - b)

Solution (Python):
a, b = map(int, input().split())
n = b - a
print(n * (n - 1)//2 - a)

Solution (Python):
a,b = map(int,input().split())
towernumber = b-a
print(sum(list(range(towernumber+1)))-b)

Solution (Python):
a, b = map(int, input().split())

gap = b - a
tower = 0
for i in range(1, gap+1):
    tower += i

print(tower-b)

Solution (Python):
a,b= map(int,input().split())
n = b-a
ah = n*(n-1)//2
print(ah-a)

Solution (Python):
A, B = map(int, input().split())
A_t = 0
for i in range(1, B-A):
  A_t += i
print(A_t -A)

Solution (Python):
a,b = map(int,input().split())
print(((b-a)*(b-a+1))//2-b)

Solution (Python):
a, b = map(int, input().split())
d = b - a
h = d * (d - 1) // 2
print(h - a)

Solution (Python):
a,b=map(int,input().split())
n=b-a
print(n*(n+1)//2-b)

Solution (Python):

import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)

a, b = map(int, input().split())
left = sum(range(1, b - a))
print(left-a)

Solution (Python):
a, b = map(int, input().split())
ba = b - a
s=0
for i in range(1, ba+1):
    s+=i
print(s-b)

Solution (Python):
a, b = map(int, input().split())
n = b - a
res = 0
for i in range(1, n + 1):
  res += i
print(res - b)

Solution (Python):
a, b = map(int, input().split())
ans = 0
diff = b - a
for i in range(diff + 1):
    ans += i
print(ans - b)

Solution (Python):
a,b=(int(x) for x in input().split())
def f(n):
    s=0
    for i in range(1,n+1):
        s+=i
    return s
print(f(b-a-1)-a)

Solution (Python):
a,b=map(int,input().split())
x=b-a
ans=0
for i in range(x+1):
    ans+=i

print(ans-b)

Solution (Python):
a,b = map(int,input().split())
c = b-a
sum = 0
for i in range(1,c):
  sum += i
print(sum-a)

Solution (Python):
a, b = map(int,input().split())
a_len = sum([_ for _ in range(b-a)])
print(a_len-a)

Solution (Python):
a, b = map(int, input().split())
n = b-a
print(n*(n-1)//2 - a)

Solution (Python):
a, b = map(int, input().split())
dif = b - a
sum = 0
for i in range(1, dif+1):
    sum += i
print(sum - b)

Solution (Python):
a,b = map(int,input().split())

h = 0
for i in range(1,b-a+1):
    h += i
print(h-b)

Solution (Python):
a, b = map(int, input().split())

print((b - a) * (b - a + 1) // 2 - b)

Solution (Python):
a,b=map(int,input().split())
print((b-a-1)*(b-a)//2-a)

Solution (Python):
a,b = map(int,input().split())
print((b-a)*(b-a+1)//2-b)

Solution (Python):
a, b = map(int, input().split())
n = b - a
print(sum(range(1, n+1)) - b)

Solution (Python):

a,b = map(int,input().split())
s = 0
for i in range(b-a):
    s += i
print(s-a)

Solution (Python):
a,b =map(int,input().split())

print(int(((b-a)*(b-a+1))/2-b))

Solution (Python):

import sys


def ILI(): return list(map(int, sys.stdin.readline().rstrip().split()))
def ISI(): return map(int, sys.stdin.readline().rstrip().split())
def II(): return int(sys.stdin.readline().rstrip())
def ISS(): return sys.stdin.readline().rstrip().split()
def IS(): return sys.stdin.readline().rstrip()

a, b = ISI()
c = b - a
height = 0
for i in range(1, c):
    height += i
print(height - a)

Solution (Python):
a, b = map(int, input().split())

import sys

sys.setrecursionlimit(2000)

def f(x):
    if x == 0:
        return x
    return x + f(x - 1)

diff = b - a
east = f(diff)
print(east - b)

Solution (Python):
a, b = map(int, input().split())
sub = b - a
B = (1 / 2) * sub * (sub + 1)
print(int(B - b))

Solution (Python):
a,b = map(int,input().split())

b_a = b-a

hight_tower_a = 0
for i in range(1,b_a):
  hight_tower_a += i


ans = hight_tower_a - a
print(ans)

Solution (Python):
a, b = map(int, input().split())

Si = 0
Sj = 0
k = 1
flag = False
for i in range(1, 1000):
  Si += i
  for j in range(k, i):
    Sj += j
    if (Si - Sj) == (b - a):
      flag = True
      break
    k = j+1
  if flag:
    break
print(Sj - a)

Solution (Python):
a,b=map(int,input().split())
d=b-a
print((d*(d+1)//2)-b)

Solution (Python):
import sys
from collections import deque
from functools import reduce
import copy
import math


sys.setrecursionlimit(4100000)


def inputs(num_of_input):
    ins = [input() for i in range(num_of_input)]
    return ins


def solve(inputs):
    [A, B] = string_to_int(inputs[0])
    trees = [0]
    for i in range(1, 1000):
        trees.append(trees[i-1] + i)

    diff = B - A
    return trees[diff] - B


def string_to_int(string):
    return list(map(int, string.split()))


if __name__ == "__main__":
    ret = solve(inputs(1))
    print(ret)

Solution (Python):
(a, b) = (int(tok) for tok in input().split())
towers = b - a

snow = towers * (towers + 1) // 2 - b
print(snow)

Solution (Python):
a, b = map(int, input().split())
tmp = b-a
print(((1+tmp-1)*(tmp-1))//2 - a)

Solution (Python):
a,b=map(int,input().split())
print(((b-a)**2-a-b)//2)

Solution (Python):
a, b = map(int, input().split())
d = b-a
r = d*(d+1)//2-b
print(r)

Solution (Python):
a,b = map(int,input().split())
s = sum(range(1,(b-a)))
print(s-a)

Solution (Python):
import sys
from collections import deque
from collections import  Counter
import statistics
import math
stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline()

a, b = na()
li = [1]
d = b - a
for i in range(2, 1000):
    li.append(li[-1] +i)
print(li[d-2] - a)

Solution (Python):
a,b=map(int,input().split())
n=b-a
print(n*(n+1)//2-b)

Solution (Python):
a, b = map(int, input().split())
c = b-a

h = c*(c+1)//2
print(h-b)

Solution (Python):
a, b = map(int, input().split())
d = b - a
print(d * (d + 1) // 2 - b)

Solution (Python):
import sys
import math
from fractions import gcd





def lcm(a, b):
    return a * b // gcd(a, b)

def combination_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

def permutations_count(n, r):
    return math.factorial(n) // math.factorial(n - r)

big_prime = 1000000007

"""


 =  sys.stdin.readline().rstrip()
 =  list(sys.stdin.readline().rstrip())


 =  int(sys.stdin.readline())
 =  map(int, sys.stdin.readline().split())
 =  list(map(int, sys.stdin.readline().split()))
 =  [list(map(int,list(sys.stdin.readline().split()))) for i in range(N)]
"""
a, b  =  map(int, sys.stdin.readline().split())

A = 0

for i in range(b - a, 0, -1):
    A += i

print(A - b)

Solution (Python):
a,b=map(int,input().split());print((b-a)*(b-a-1)//2-a)

Solution (Python):
a, b = map(int, input().split())
print((b-a)*(b-a+1)//2-b)

Solution (Python):
a, b = map(int, input().split())

print(int((b-a)*(b-a+1)/2 - b))

Solution (Python):
a,b = map(int, input().split())
c = []
c.append(1)

for i in range(1,1000):
  c.append(0)
for i in range(1,1000):
  c[i] = c[i-1] + i + 1 
  
  if b - a == i + 1 :
    print(c[i-1]-a)

Solution (Python):
a,b = map(int, input().split())


bi = b - a
b_height=sum(range(1,bi+1))
yuki = b_height - b
print(yuki)

Solution (Python):
a,b = map(int, input().split())


bi = b - a
b_height=sum(range(1,bi+1))
yuki = b_height - b
print(yuki)

Solution (Python):
a,b = map(int, input().split())


bi = b - a
b_height=sum(range(1,bi+1))
yuki = b_height - b
print(yuki)

Solution (Python):
a,b=map(int,input().split())
for i in range(1,1000):
    if i==b-a:
        print(i*(i+1)//2-b)

Solution (Python):
a, b = map(int, input().split())
h = [sum(range(i + 1)) for i in range(1, 1000)]
print(h[b - a - 2] - a)

Solution (Python):
a,b=map(int,input().split())

print(int((b-a)*(b-a+1)/2-b))

Solution (Python):


def main():

    a,b= map(int,input().split())

    print(sum(range(1,b-a+1))-b)

if __name__== "__main__":
    main()

Solution (Python):
a,b = map(int,input().split())
sm = 0
for i in range(b-a+1):
  sm+=i
print(sm-b)

Solution (Python):
a, b = map(int, input().split())

s = 0
for i in range(b-a):
  s += i
  
print(s - a)

Solution (Python):
a, b = map(int, input().split())
n = b-a
X = n * (n+1) //2
print(X-b)

Solution (Python):
a, b = map(int, input().split())
n = b-a
X = n * (n+1) //2
print(X-b)

Solution (Python):
a,b=map(int,input().split())

i=1
cn=0
temp=0

while i<1000:
  cn=cn+i
  if i==b-a:
    print(cn-b)
    break
  
  i+=1

Solution (Python):
x,y = map(int,input().split())
h=y-x
a=0
for i in range(h-1):
   a+=i+1
print(a-x)

Solution (Python):
def summation(x):
    if x == 1:
        return 1
    else: 
        return x + summation(x-1)

a,b = map(int,input().split())
n = b - a
print(summation(n-1) - a)

Solution (Python):
a,b=map(int,input().split())
m=1
for i in range(2,1000):
    if a-m==b-m-i:
        print(m-a)
        break
    m+=i

Solution (Python):
a, b = map(int, input().split())
c = b - a
d = 0
for i in range (1, c):
  d += i
print(d - a)

Solution (Python):
x,y = map(int,input().split())
h=y-x
a=0
for i in range(h-1):
   a+=i+1
print(a-x)

Solution (Python):
a,b=map(int,input().split())
print(sum([i for i in range(b-a)])-a)

Solution (Python):
a,b = map(int, input().split())
m = b-a
ans = 0

for i in range(m+1):
    ans += i

print(ans-b)

Solution (Python):
def main():
    a, b = map(int, input().split())
    return (b-a)*(b-a+1)//2 - b

if __name__ == '__main__':
    print(main())

Solution (Python):
a,b=map(int,input().split())
ans=(b-a)*(b-a+1)//2-b
print(ans)

Solution (Python):
a, b = map(int, input().split())
d = b - a
for i in range(1,999):
    Si = i * (i + 1) // 2
    Sii = (i + 1) * (i + 2) // 2
    Sd = Sii - Si
    if d == Sd:
        height = Si
        break
print(height - a)

Solution (Python):
a,b=map(int,input().split())
print(sum(range(b-a))-a)

Solution (Python):
a, b = map(int, input().split())

diff = b - a

org_b = 0
for i in range(1, diff + 1):
    org_b += i

print(org_b - b)

Solution (Python):
a,b=map(int,input().split())
ab=b-a

check=0
for i in range(1,ab+1):
    check+=i
    
print(check-b)

Solution (Python):
a, b = map(int, input().split())

diff  = b - a
west_tower = sum([i for i in range(b-a)])

snow = west_tower - a

print(snow)

Solution (Python):
a, b = (int(i) for i in input().split())
print(sum(range(b-a))-a)

Solution (Python):
a,b = map(int,input().split())
sa = b-a

sigma = []
diff = []

tmp = 0
for i in range(1,1000):
    tmp += i
    sigma.append(tmp)

    if i >= 2:
        diff.append(sigma[i-1]-sigma[i-2]) 
        if sigma[i-1] - sigma[i-2] == sa:
            print(sigma[i-1] - b)

Solution (Python):
def resolve():
    a, b = map(int, input().split())
    diff = b - a
    ans = diff * (diff + 1) // 2 - b
    print(ans)


if __name__ == "__main__":
    resolve()

Solution (Python):
a,b = map(int,input().split())
diff = b - a
print(sum([i for i in range(1,diff+1)])-b)

Solution (Python):
a,b=map(int, input().split())

height=1
for i in range(2,b-a):
    height+=i
print(height-a)

Solution (Python):

a, b = map(int, input().split())
diff = b - a

s = 0
for i in range(1, b+1):
    s += i

    if i == diff:
        print(s - b)
        exit()

Solution (Python):
a, b = [int(x) for x in input().split()]
print(sum([x for x in range(1, b - a)]) - a)

Solution (Python):
a,b=map(int,input().split())

c=b-a
d=0

for i in range(1,c+1):
	d+=i

print(d-b)

Solution (Python):
a, b = map(int, input().split())

i = 0
s = 0

for i in range(1, b - a):
    s += i
print(s - a)

Solution (Python):
a,b=map(int,input().split())
c=b-a

h=0
for i in range(1, c+1):
  h+=i
print(h-b)

Solution (Python):
a,b=map(int, input().split())
x=b-a
sum=0
for i in range(1,x+1):
    sum+=i
print(sum-b)

Solution (Python):
import sys
def input(): return sys.stdin.readline().strip()
a,b=map(int,input().split())
print(sum(range(b-a))-a)

Solution (Python):
a, b = map(int, input().split())
print(sum([i for i in range(b-a)]) - a)

Solution (Python):
a,b=list(map(int,input().split()))
n=b-a
print(n*(n+1)//2 - b)

Solution (Python):
a,b=list(map(int,input().split()))
x=0
for i in range(1,b-a+1):
  x+=i
print(x-b)

Solution (Python):
a, b = map(int, input().split())
t = 0
for i in range(b - a):
    t += i
print(t - a)

Solution (Python):
a,b=input().split()
a,b=int(a),int(b)

x=0
for i in range(b-a):
    x+=i
print(x-a)

Solution (Python):
def main():
    a, b = map(int, input().split())

    height = [0] * 1000

    for i in range(999):
        height[i+1] = height[i] + i + 1

    for i in range(1,999):
        diff_a = height[i] - a
        diff_b = height[i+1] - b
        if diff_a >= 0 and diff_b >= 0 and diff_a == diff_b:
            print(diff_a)
            exit()

main()

Solution (Python):
a, b = map(int, input().split())
diff = b - a
c = sum(list(range(diff)))
ans = c - a
print(ans)

Solution (Python):
a, b = map(int, input().split())
n = b - a
num = 0
for i in range(1, n):
    num += i
print(num - a)

Solution (Python):
a, b = [int(x) for x in input().split()]
print(sum([i for i in range(1,b-a+1)])-b)

Solution (Python):
a,b = map(int,input().split())
c = b-a
k = 0
for i in range(1,c):
  k += i
print(k-a)

Solution (Python):
a, b = map(int, input().split())
print((b - a) * (b - a + 1) // 2-b)

Solution (Python):
a, b = map(int,input().split())
c = b-a
tower_height = sum(list(range(1,c+1)))

print(tower_height-b)

Solution (Python):
a, b = map(int, input().split())

lst = [1]

for i in range(2, 1000):
  lst.append(i + lst[i-2])
print(lst[b-a-1] - b)

Solution (Python):
w,e = map(int,input().split())
diff = e-w
true_height=0
for h in range(1,diff+1):
  true_height+=h
print(true_height-e)

Solution (Python):
a, b = map(int, input().split())
cnt = 0
for i in range(b-a):
    cnt += int(i)
print(cnt-a)

Solution (Python):
a,b = list(map(int,input().split()))

sa = b - a
high = 0

for i in range(sa):
    high += i

print(high - a)

Solution (Python):
a,b = map(int,input().split())
cnt = 0
for i in range(b-a):
  cnt += i
print(cnt-a)

Solution (Python):
a, b = map(int, input().split())

print(((b-a)*(b-a+1))//2 - b)

Solution (Python):
a, b = (int(i) for i in input().split()) 
print(int(0.5*(b-a)*(b-a+1)-b))

Solution (Python):


a,b = map(int,input().split())
n = b-a-1
h = (n*(n+1))//2
print(h-a)

Solution (Python):
a,b=map(int,input().split())

num=b-a
hight=0
for i in range(num):
    hight+=i

print(hight-a)

Solution (Python):
a,b = (int(i) for i in input().split())

diff = b - a
ans = diff * (diff+1) // 2
ans -= b
print(ans)

Solution (Python):
a,b=map(int,input().split());x=b-a;print(x*(x-1)//2-a)

Solution (Python):
a,b = map(int, input().split())
print((b-a)*(b-a+1)//2 - b)

Solution (Python):
a,b = map(int, input().split())
polls = []
for i in range(1,1000):
    polls.append(sum(list(range(1,1000))[:i]))

d = {}
for i in range(1, len(polls)):
    d[polls[i]-polls[i-1]] = [polls[i-1],polls[i]]

print(d[b-a][0] - a)

Solution (Python):
a,b = map(int,input().split())
diff = b - a
ans = diff * (diff+1) // 2
ans -= b
print(ans)

Solution (Python):
a, b = map(int, input().split())
n = b - a
h = 0
for i in range(1, n+1):
    h += i
print(h-b)

Solution (Python):
a, b = map(int, input().split())
total = 0
for i in range(b - a):
    total += i
print(total - a)

Solution (Python):
a,b = map(int,input().split())
d = b-a
print(d*(d-1)//2-a)

Solution (Python):
a,b = map(int,input().split())
n = b-a
print(n*(n+1)//2-b)

Solution (Python):
a, b = map(int, input().split())

l = sum(range(1, b - a))
print(l - a)

Solution (Python):
a, b = map(int, input().split())
k = b - a - 1   
ans = k * (k + 1) // 2 - a
print(ans)

Solution (Python):
a, b = map(int, input().split())
diff = b - a
sumB = int(diff * (diff + 1) / 2)
ans = sumB - b
print(ans)

Solution (Python):
a,b = map(int, input().split())

diff = b-a
old_i = 1
for i in range(2,1000):
    now_i = int(i*(i+1)/2)
    if now_i - old_i == diff:
        print(now_i-b)
        break
    old_i = now_i

Solution (Python):
A,B=map(int,input().split())

res = (B-A)*(B-A-1)//2-A
print(res)

Solution (Python):
a,b=map(int,input().split())
n=b-a
x=n*(n+1)//2
print(x-b)

Solution (Python):
a, b = map(int,input().split())

var = b - a
len_right = var * (var + 1) // 2

print(len_right - b)

Solution (Python):
a, b = [int(i) for i in input().split()]

diff = b-a

sumb = diff*(diff+1)/2

print(int(sumb)-b)

Solution (Python):
a, b = list(map(int, input().split()))

stopper=b-a
height=0
ix=1

while stopper != ix:
    height += ix
    ix += 1

print(height - a)

Solution (Python):
a,b=map(int,input().split())
tower=0
for i in range(b-a):
    tower+=(i+1)
print(tower-b)

Solution (Python):
a, b = list(map(int,input().split(' ')))
ar = []
x = 0
for i in range(1,1000):
  x_ = x
  x+=i
  if x-x_ == b-a :

    break
  
print(x-b)

Solution (Python):
a,b=map(int,input().split());print(((a-b)**2-(a+b))//2)

Solution (Python):
a, b = map(int, input().split())

n = b - a
ans = sum(range(n)) - a

print(ans)

Solution (Python):
a, b = list(map(int,input().split()))
sum = 0
for i in range(1, b-a+1):
    sum += i
print(sum-b)

Solution (Python):
a,b = map(int, input().split())
print(int(((b-a)*(b-a+1))/2) - b)

Solution (Python):

a, b = map(int, input().split(' '))

i = b - a
print(int(i*(i+1)/2 - b))

Solution (Python):
a,b = map(int,input().split())

s = b - a

cnt = 1
res = 0

for i in range(s):
    res += cnt
    cnt += 1
    
print(res - b)

Solution (Python):
a, b = map(int, input().split())
diff = b - a
print(diff * (diff + 1) // 2 - b)

Solution (Python):
a, b = map(int, input().split())
ans = 0
for i in range(b - a):
    ans += i
print(ans - a)

Solution (Python):
a,b = map(int,input().split())
x = b-a
print(x*(x+1)//2 - b)

Solution (Python):
a,b = map(int, input().split())
c = b-a
d = 0
tmp = 0
for i in range(c+1):
    d += i
ans = d -b
print(ans)

Solution (Python):
a,b=map(int,input().split())
print((b-a)*(b-a+1)//2-b)

Solution (Python):












a, b = map(int, input().split())

for k in range(1, 999):
    t1 = k * (k + 1) // 2
    t2 = (k + 1) * (k + 2) // 2
    u = t1 + t2 - a - b
    if (t1 + t2 - a - b) % 2 == 0 and u > 0:
        u = u // 2
        if u <= t1 and u <= t2 and t1 - u == a and t2 - u == b:
            print(u)

Solution (Python):
a, b = map(int, input().split())
li = [i for i in range(1, b-a)]
print(sum(li)-a)

Solution (Python):


a,b = map(int,input().split())


c = b - a
d = 0
for i in range(1, c):
    d += i
print(d - a)

Solution (Python):




a,b = list(map(int,input().split(" ")))



def ans(n):
  an = 0
  for i in range(1,n+1):
    an += i
  return an

print(ans(b - a) - b)

Solution (Python):
a, b = map(int, input().split())

c = b - a
s = sum(range(1, c+1))
print(s - b)

Solution (Python):
a,b=map(int,input().split())
be=b-a
bh=(1+be)*be//2
print(bh-b)

Solution (Python):
a, b = map(int, input().split())
print((b - a) ** 2 // 2 - (b + a) // 2)

Solution (Python):
a, b = map(int, input().split())
X = [1]
for i in range(1, 999):
    X.append(X[i-1]+i+1)
diff = b - a
print(X[diff-1] - b)

Solution (Python):
a, b = map(int, input().split())

s = 0
for i in range(1, b - a):
    s += i
print(s - a)

Solution (Python):
def main():
    a, b = map(int, input().split())
    x = b - a
    ans = x * (x+1) // 2 - b
    print(ans)


if __name__ == "__main__":
    main()

Solution (Python):
a, b = map(int, input().split())
ansb = 0
tmp = b - a
for i in range(tmp, 0, -1):
    ansb += i
print(ansb - b)

Solution (Python):
a, b = map(int, input().split())
h = (b-a)*(b-a+1)//2
print(h-b)

Solution (Python):
a, b = map(int, input().split())
c = 0
for i in range(b-a+1):
    c += i
print(c-b)

Solution (Python):

from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
import itertools
sys.setrecursionlimit(10**5)
stdin = sys.stdin
def LI(): return list(map(int, stdin.readline().split()))
def LF(): return list(map(float, stdin.readline().split()))
def LI_(): return list(map(lambda x: int(x)-1, stdin.readline().split()))
def II(): return int(stdin.readline())
def IF(): return float(stdin.readline())
def LS(): return list(map(list, stdin.readline().split()))
def S(): return list(stdin.readline().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float("INF")


def A():
    n = II()
    if n < 1000:
        print("ABC")
    else:
        print("ABD")
    return


def B():
    a, b = LI()
    x = b - a - 1
    print((1 + x) * x // 2 - a)
    return


def C():
    n = II()
    dp = [inf for i in range(n + 1)]
    ans = [1]
    x = 6
    while x <= n:
        ans.append(x)
        x = x * 6
    x = 9
    while x <= n:
        ans.append(x)
        x = x * 9
    ans.sort()
    for i in ans:
        dp[i] = 1
    for i in range(1, n + 1):
        if not i in ans:
            a = bisect.bisect_left(ans, i)
            for k in range(a):
                dp[i] = min(dp[i - ans[k]] + 1, dp[i])
    print(dp[n])
    return


def D():
    n, c = LI()
    D = LIR(c)
    C = LIR_(n)
    CL = list(itertools.permutations(range(c), 3))
    ans = inf
    amari0 = [0 for i in range(30)]
    amari1 = amari0[::1]
    amari2 = amari0[::1]
    for y in range(n):
        for x in range(n):
            amari = (x + y) % 3
            if amari == 0:
                amari0[C[y][x]] += 1
            if amari == 1:
                amari1[C[y][x]] += 1
            if amari == 2:
                amari2[C[y][x]] += 1
    for c0, c1, c2 in CL:
        ansb = 0
        for i in range(c):
            ansb += D[i][c0] * amari0[i]
            ansb += D[i][c1] * amari1[i]
            ansb += D[i][c2] * amari2[i]
        ans = min(ans, ansb)
    print(ans)
    return


if __name__ == '__main__':
    B()

Solution (Python):
a, b = map(int, input().split())

print(int(((((1+ (b - a)) * (b - a)) / 2 - b))))

Solution (Python):
a, b = map(int, input().split())
c = 0
li = []
for i in range(1, 1000):
	c += i
	li.append(c)
for i in range(999):
	if li[i] - a == li[i+1] - b:
		d = li[i] - a
		break
print(d)

Solution (Python):
a,b=map(int,input().split())
print(sum(range(b-a))-a)

Solution (Python):


import sys
sys.setrecursionlimit(500000)

def function(n):
    if n == 0: return 0
    else:
        return n + function(n - 1)

a, b = map(int, input().split())
print(function(b - a) - b)

Solution (Python):
a, b = list(map(int, input().split()))
a_h = 0
for i in range(b - a):
  a_h+=i
print(a_h - a)

Solution (Python):
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
 
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

a, b = MAP()
c = 0
l = []


sa = b - a
for i in range(1, 1000):
    c += i
    l.append(c)

print(l[sa - 2] - a)

Solution (Python):
a,b = map(int,input().split())
print((b-a)*(b-a+1)//2-b)

Solution (Python):
a, b = map(int, input().split())
t = [(sum(range(1, i+1))) for i in range(1, 1000)]
print(t[b-a-1] - b)

Solution (Python):
a,b = map(int,input().split())
total = 0
for i in range(b-a):
  total += i
print(total-a)

Solution (Python):
a, b = map(int, input().split())
c = 0
for i in range(1, (b-a)+1):
    c += i
print(c-b)

Solution (Python):
a, b = map(int, input().split())
c = b-a
print(c * (c+1) // 2 - b)

Solution (Python):
a,b=map(int,input().split())
bth=b-a
bh=sum(range(1, bth + 1))
print(bh-b)

Solution (Python):
a, b  = map(int, input().split())
d = b - a
an = (d**2 + d) / 2
print(round(an - b))

Solution (Python):
from functools import reduce
import math

def main():
    
    
    
    

    
    
    
    
    
    

    
    

    
    
    
    
    
    
    
    
    
    INF = float("inf")

    
    MOD = 10**9+7
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    a, b = (int(_) for _ in input().split())
    orig_a = 0
    for i in range(b-a):
        orig_a +=i
    print(orig_a - a)
    
if __name__ == '__main__':
    main()

Solution (Python):
a, b = map(int, input().split(" "))
print((b - a - 1) * (b - a) // 2 - a)

Solution (Python):
a,b = map(int,input().split())
c = 0
for i in range(1,b-a):
  c += i
print(c-a)

Solution (Python):
a,b = map(int, input().split())

x = b-a
hi = 0
for i in range(1,1000):
    if i == x:
        break
    hi += i

print(hi - a)

Solution (Python):
A, B = map(int, input().split())
D = B - A
sum = 0
for i in range(0, D+1):
	sum += i
print(sum-B)

Solution (Python):
a = list(map(int,input().split()))
b = 0
c = []

for i in range(1000):
  b+=i
  c.append(b)
else:
  print(c[a[1]-a[0]-1]-a[0])

Solution (Python):
a,b = map(int, input().split())

diff = b-a
H = diff*(diff-1)//2
print(H-a)

Solution (Python):
import sys

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

if __name__ == "__main__":
    a, b = map(int, input().split())

    print((b-a) * (b-a+1) // 2 - b)

Solution (Python):
import sys

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

if __name__ == "__main__":
    a, b = map(int, input().split())

    sum = 0
    for i in range(1, (b-a)+1):
        sum += i

    print(sum - b)

Solution (Python):
a,b = map(int, input().split())
diff = b - a
count = 0
for i in range(1,diff+1):
    count += i
print(count - b)

Solution (Python):
a, b = map(int, input().split())

x = b - a
xb = x * (x + 1) // 2

print(xb - b)

Solution (Python):
a, b = map(int, input().split())

towers = [sum(range(1, n)) for n in range(2, 1001)]
diffs = [0] * 998
for i in range(998):
    diffs[i] = towers[i + 1] - towers[i]
i = diffs.index(b - a)
print(towers[i] - a)

Solution (Python):
a, b = map(int, input().split())

c = b - a - 1
print(c*(c+1)//2 - a)

Solution (Python):
a, b = map(int, input().split())
diff = b - a
h = 0
for i in range(1, diff+1):
    h += i
print(h - b)

Solution (Python):
a, b = map(int, input().split())

print(sum([i for i in range(1000) if i <= (b-a)])-b)

Solution (Python):
a, b = map(int, input().split())
print(sum(range(b-a+1)) - b)

Solution (Python):
a,b=map(int,input().split())
x=b-a

num=0
for i in range(1,x+1):
    num+=i
print(num-b)

Solution (Python):
a, b = map(int, input().split())
x = (b-a-1)*(b-a)//2
print(x - a)

Solution (Python):
a, b = map(int, input().split())
x = 0
for i in range(1, b-a):
    x += i

print(x - a)

Solution (Python):
a,b = map(int,input().split())
n = b-a-1
print(n*(n+1)//2-a)

Solution (Python):
a,b=map(int,input().split())
N=b-a
B=N*(N+1)//2
ans=B-b
print(ans)

Solution (Python):
a,b = map(int,input().split())
dst = b-a
height = 0
for i in range(dst):
    height += i
print(height-a)

Solution (Python):
a,b=map(int,input().split())
diff=b-a
snow=int((diff-1)*diff/2)-a
print(snow)

Solution (Python):
a,b=map(int,input().split())
cstl=[(1+i)*i/2 for i in range(1,1000)]
for i in range(len(cstl)-1):
    if cstl[i]-a == cstl[i+1]-b:
        print(int(cstl[i]-a))
        exit()

Solution (Python):
a, b = map(int, input().split())

d = b - a
j = 0

for i in range(1,1000):
    k = j
    j += i
    if j - k == d:
        print(j - b)
        break

Solution (Python):
a,b=map(int, input().split())
ans=0
c=b-a
for i in range(c):
    ans+=i+1
print(ans-b)

Solution (Python):

import sys
import copy
import collections
from bisect import bisect_left
from bisect import bisect_right
from collections import defaultdict
from heapq import heappop, heappush
import numpy as np
import statistics
from statistics import mean, median,variance,stdev
import math

def main():
	a, b = map(int, input().split(" "))
	
	takasa = []
	takasa.append(0)
	sa = []
	sa.append(0)
	for i in range(1, 1000):
		tmp = takasa[i-1] + i
		takasa.append(tmp)
	
	tmp = b - a
	
	print(takasa[tmp]-b)
	
	
	
if __name__ == "__main__":
	main()

Solution (Python):

import time
import re
import math
import fractions

def main():
    A,B=map(int,input().split())
    index=B-A-1
    total=0
    for a in range(0,index+1):
        total+=a+1
    print(total-B)
start=time.time()
main()

Solution (Python):

height = [int(x) for x in input().split()]
s = height[1] - height[0]
count = 0
for x in range(s):
    count += x
print(count - height[0])

Solution (Python):
a, b = map(int, input().split(" "))

delta = b - a

high_east = (1 + delta) * delta // 2
snow = high_east - b

print(snow)

Solution (Python):
a,b=map(int,input().split())
print(int((b-a)*(b-a+1)/2 -b))

Solution (Python):
a,b = map(int,input().split())
x = b-a
print(int((x+1)*x/2-b))

Solution (Python):
nl = lambda: list(map(int, input().split()))
sl = lambda: input().split()
n = lambda: int(input())
s = lambda: input()

a, b = nl()

total = 0
for i in range(1, b - a):
    total += i

print(total - a)

Solution (Python):

a,b = map(int,input().split())
h = 0

for i in range(b - a):

    h += (i+1)

print (h - b)

Solution (Python):
a, b = map(int, input().split())
n = b -a
print(int(0.5 * n * (n + 1)) - b)

Solution (Python):
a, b = map(int, input().split())
sum = sum(range(b-a))
print(sum-a)

Solution (Python):
a,b=map(int,input().split())
S=(b-a)*(1+(b-a))//2
print(S-b)

Solution (Python):
a,b = map(int,input().split())
c = b - a
d = c*(c+1)/2
x = d - b
print(int(x))

Solution (Python):
a,b = map(int,input().split())
c = b - a
d = c*(c+1)/2
x = d - b
print(int(x))

Solution (Python):
a,b=map(int,input().split())
print((b-a)*(1+b-a)//2-b)

Solution (Python):
a,b = list(map(int,input().split()))
c = []
sum = 1
am = 0
bm = 0
for i in range(998) :
    am =sum - a 
    sum = sum + i+2
    bm =sum - b
    if am == bm :
        print(am)
        break

Solution (Python):
a,b = map(int,input().split())
c = []
d = 0
for i in range(1,1000):
     d += i
     c.append(d)
print(c[b-a-1]-b)

Solution (Python):
a, b = map(int, input().split())

height=0
for h in range(1, 999):
    height += h
    nextH = height + h + 1

    if height < a:
        continue

    if height - a == nextH - b:
        print(height - a)
        exit()

Solution (Python):
a,b = map(int, input().split())
high = 0

for i in range(b - a):
	high += i
print(high - a)

Solution (Python):
a, b = map(int, input().split())
diff = b-a
h = 0

for i in range(diff):
  h += i
print(h - a)

Solution (Python):
import math

a, b = map(int,input().split())
c = b - a
for i in range(1,999):
  d = sum(range(1,i+2)) - sum(range(1,i+1))
  if d == c:
    e = sum(range(1,i+1)) - a
print(e)

Solution (Python):
a,b = map(int, input().split())
print(sum(range(b - a + 1)) - b)