a = int(input())
b = int(input())
if a < b:
    k = b - a
    z = k//2 +1
else:
    q = a - b
    z = q // 2 + 1
    
k = b - a
q = a - b
    
if k == 1 or q == 1:
    print(1)
elif k == 2 or q == 2:
    print(2)
else:
    for i in range(1, z+1):
       i += i 
    for j in range(1, z):
        i += j
    print(i)
    