a=int(input())
b=int(input())
sum=0
c=(abs(a-b))//2
if c==0:
    print(1)
elif abs(a-b)%2==0:
    for i in range(c):
        sum+=(i+1)*2
    print(sum)    
else:
    for i in range(c):
        sum+=(i+1)*2
    sum+=(i+2)    
    print(sum)    