sum = 0 a = int(input()) for i in range(1,a): sum = sum + i print(sum)