
import math
a=int(input())
b=int(input())
x,y=max(a,b),min(a,b)
d=x-y
sum=0
if d%2==0:
	for i in range(1,d//2+1):
		sum=sum+i*2
else:
	for i in range(1,d//2+1):
		sum=sum+i*2
	sum=sum+math.ceil(d/2)
	
print(sum)

   


        
