from decimal import Decimal

N = int(eval(input()))

print((Decimal(N * (N - 1) // 2)))
from decimal import Decimal

N = int(eval(input()))

print((int(Decimal(1/2) * Decimal(N) * Decimal(N - 1))))
from decimal import Decimal

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

from decimal import Decimal

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

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