# coding: utf-8

# Your code here!

N=int(eval(input()))

 

print((int(N*(N-1)//2)))
# coding: utf-8

# Your code here!



N=int(eval(input()))



print((N*(N-1)//2))
# coding: utf-8
# Your code here!
N = int(eval(input()))
print((int(N * (N - 1) // 2)))

# coding: utf-8
# Your code here!
N = int(eval(input()))
print((N * (N - 1) // 2))

-print((int(N * (N - 1) // 2))) +print((N * (N - 1) // 2))