#To take input
# str = raw_input()
# R = float(str.split()[0])
# real = int(str.split()[1])
# R, x1, y1, x2, y2 = map(int, raw_input().split(' '))
# print "{} {} {}".format(x3, y3, r)
a = int(raw_input())
b = int(raw_input())
d1=0
d2=0
p=0
mx=max(a,b)
mn=min(a,b)

if(mx - mn) == 1 :
    print(1)
else :
    d = mx-mn
    md=d/2
    d = mn+md
    p = d-mn
    d1 = (p*(1+p))/2
    p = mx-d
    d2 = (p*(1+p))/2
    print(d1+d2)
