n=int(eval(input()))

t=n-1

ans=t*(t+1)

print((ans//2))

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

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

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

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