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

c = abs(a-b)
c1 = int(c/2)
c2 = int(c - c/2)
for i in range(1,c1+1):
    for j in range(1,c2+1):
        sum1 = (c1*(c1+1)/2) + (c2*(c2+1)/2)

    print(int(sum1))
    break
