N=int(eval(input()))

S=(N+1)*N//2

print(S)
n = int(eval(input()))

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

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

-N = int(eval(input())) -S = (N + 1) * N // 2 -print(S) +n = int(eval(input())) +print((n * (n + 1) // 2))