x = int(raw_input())
y = int(raw_input())

dif = abs(x - y)

total = 0

steps = [0] * 501

for i in range(1,501):
    steps[i] = steps[i - 1] + i

if(dif % 2 != 0):
    index = (dif/2)
    index2 = (dif/2) + 1
    total += steps[index]
    total += steps[index2]
else:
    total += steps[(dif/2)] * 2

print(total)

  					 						 	  		 	   	   	