def minSteps(a, b):
    diff = abs(a - b)
    n = diff // 2
    if diff % 2 == 0:
        return n * (n + 1)
    else:
        return (n * (n + 1) // 2) + ((n + 1) * (n + 2) // 2)

a = int(input())
b = int(input())
print(minSteps(a, b))