import math 

x1 = int(raw_input())
x2 = int(raw_input())

diff = abs(x1 - x2)
steps = diff / 2

t = (steps * ( steps + 1 ) ) / 2
if diff % 2 == 1:
    e = steps + 1 
else:
    e = 0
print 2 * t + e 
