from decimal import Decimal





n = int(eval(input()))



ans = (Decimal((n - 1) * n) / 2)

print(ans)

n = int(eval(input()))



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

print(ans)

from decimal import Decimal

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

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

-from decimal import Decimal - -ans = Decimal((n - 1) * n) / 2 +ans = ((n - 1) * n) // 2