N = int(eval(input()))



S = sum(range(1,N))



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

n -= 1



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

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

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