def sumOfNum(n):
    return ( ( n * ( n + 1 ) ) / 2 )

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

dist = abs(a - b)
tired1 = dist // 2
tired2 = dist - tired1

TotalTired = sumOfNum(tired1) + sumOfNum(tired2)

print(int(TotalTired))