a = int(input())
b = int(input())
if a>b:
    x = a-b
else:
    x=b-a

if x%2==0:
    y = x/2
    print(int(2*y/2*(2+y-1)))
elif x%2==1:
    y = x//2
    z= x-y
    print(int(y/2*(2+y-1)+ z/2*(2+z-1)))

