n = int(eval(input()))

ans = 0

for i in range(n):

    ans += i



print(ans)
n = int(eval(input())) - 1

ans = (1 + n)*n//2



print(ans)
n = int(eval(input()))
ans = 0
for i in range(n):
    ans += i
print(ans)

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

-n = int(eval(input())) -ans = 0 -for i in range(n): -    ans += i +n = int(eval(input())) - 1 +ans = (1 + n) * n // 2