'''Haha this is python? How could you tell, Sherlock?'''



n = int(eval(input()))

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

suu=n*(n-1)//2

print(suu)

w=[1,2,3,4]
"""Haha this is python? How could you tell, Sherlock?"""
n = int(eval(input()))
print(((n * (n - 1)) // 2))

n = int(eval(input()))
suu = n * (n - 1) // 2
print(suu)
w = [1, 2, 3, 4]

-"""Haha this is python? How could you tell, Sherlock?""" -print(((n * (n - 1)) // 2)) +suu = n * (n - 1) // 2 +print(suu) +w = [1, 2, 3, 4]