import numpy as np

N = int(eval(input()))

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

print((N*(N-1)//2))
import numpy as np

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

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

-import numpy as np -