x = int(input())
y = int(input())
s = int((y-x)/2)
if y>x:
	a = y
	b = x
else:
	a = x
	b = y

if (a-b)%2 == 1:
	s = int((a-b+1)/2)
	sum1 = int(s*(s-1)/2)
	sum2 = int(s*(s+1)/2)
	print(sum1+sum2)
else:
	s = int((a - b)/2)
	sum1 = int(s*(s+1))
	print(sum1)