import math
a = int(input())
b = int(input())

diff = abs((a) - (b))
energy = 0
for i in range(0, (diff//2) + 1):
    energy+=2*i 
    last = i
if diff%2!=0:
    energy+= 1 * (last +1)

print(energy)

    

