number = int(eval(input()))



print((int((number + 1) * number / 2)))
n = int(eval(input()))



answer = int((n + 1) * n / 2)



print(answer)

number = int(eval(input()))
print((int((number + 1) * number / 2)))

n = int(eval(input()))
answer = int((n + 1) * n / 2)
print(answer)

-number = int(eval(input())) -print((int((number + 1) * number / 2))) +n = int(eval(input())) +answer = int((n + 1) * n / 2) +print(answer)