import math

N = int(eval(input()))

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

N = int(eval(input()))

ans = ((1+N-1)*(N-1))//2

print(ans)

import math

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

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

-import math - -print(((N * (N - 1) + 2) // 2 - 1)) +ans = ((1 + N - 1) * (N - 1)) // 2 +print(ans)