N = int(input()) for i in range(1,N): s = s + i i += 1 print(s)