x = input()
y = input()
s = abs(x-y)
if(s%2 == 0):
    s = s/2
    t = (s*(s+1))//2
    t = 2*t
    print t
    exit()
else:
    s = s//2
    t = (s*(s+1))//2
    t = t*2
    t = t + s + 1
    print t
    exit()

