a=int(raw_input())
b=int(raw_input())
c=float(b+a)/2
import math
d = int(math.ceil(c))
#e = int(math.floor(c))
f = [d-a,b-d]
#g = [e-a,e-d]
ft = []
#gt = []

for i in f:
	t = 0
	for j in xrange(1,1+i):
		t+=j
	ft.append(t)

#for i in g:
#	t = 0
#	for j in xrange(1,1+i):
#		t+=j
#	gt.append(t)

print sum(ft)
