a = int(input())
b = int(input())
if abs(a - b)%2 == 0:
    ans = (abs(a-b)//2)*(abs(a-b)//2 + 1)
else:
    n1 = abs(a-b)//2
    n2 = abs(a-b) - abs(a-b)//2
    ans = n1*(n1 + 1)//2 + n2*(n2 + 1)//2
print(ans)