def sum_range(a,b):
if b >= a:
sum = 0
for i in range(a,b+1):
sum += i
return sum
else:
return 0
c1,c2 = int(input()), int(input())
print(sum_range(c1,c2))
def sum_range(a,b):
if b >= a:
sum = 0
for i in range(a,b+1):
sum += i
return sum
else:
return 0
c1,c2 = int(input()), int(input())
print(sum_range(c1,c2))