N = int(input())
print(N * (N - 1) // 2 if N > 2 else 1 if N == 2 else 0)

74d5fafee5b48119f0d767d1be2ac2240030bcdd
<mask token>

<mask token>
print(N * (N - 1) // 2 if N > 2 else 1 if N == 2 else 0)

N = int(input())
print(N * (N - 1) // 2 if N > 2 else 1 if N == 2 else 0)
