from math import ceil
n=int(input())
k=int(input())
a=abs(n-k)
c=0
if a==1:
	print(1)
elif a%2==0:
	for i in range(1,int(a/2)+1):
		c+=i*2
	print(c)		
else:
	for i in range (1,int(a/2)+1):
		c+=i*2	
	print(c+ceil(a/2))