a=int(input())
b=int(input())
diff=abs(a-b)
sum1=0
if diff==1:
    print(1)

else:
    if diff%2==0:
        for i in range(1,diff//2 + 1):
            sum1+=2*i
        print(sum1)
    else:
        for i in range(1,diff//2+1):
            sum1+= 2*i
        sum1+=diff//2 + 1
        print(sum1)
            
        
