import math

a = int(input())
b = int(input())

c = abs(a-b)
c1 = math.ceil(c/2)
c2 = math.floor(c - c/2)
for i in range(1,c1+1):
    for j in range(1,c2+1):
        #sum23 =
        pass
    print(math.ceil((c1*(c1+1)/2) + (c2*(c2+1)/2)))
    break
