from math import ceil as c
a = int(input())
b = int(input())
n = abs(a - b)
tire = 0
if n % 2 == 0:
    k = n // 2
    for i in range(1, k+1):
        tire += (2 * i)
else:
    k = c(n / 2)
    for i in range(1, k+1):
        if i == k:
            tire += i
        else:
            tire += (2 * i)
print(tire)
