import math

def not_factorial(x):
    result = x 
    for i in reversed(range(x)):
        result += i
    return result


a = int(input())
b = int(input())

distance = abs(a - b)

a =not_factorial(math.floor(distance / 2))
b =not_factorial(math.ceil(distance / 2))

print(a+b)






