a = input()
b = input()
a_b = abs(a-b)
buu = False
wyn = 0
z = 1
if a_b%2 == 1:
    buu = True
    a_b -= 1
while a_b != 0:
    wyn += 2*z
    z += 1
    a_b -= 2
if buu == True:
    print wyn+z
else:
    print wyn