a = int(input())
b = int(input())
n = abs(a - b)
f = 0
ft = 0
m = n

if n % 2 > 0:
    m = n + 1

for i in range(1, (m//2)+1):

    f = 2 * i
    ft = ft + f

if n % 2 > 0:

    ft = ft - (f//2)

print(ft)