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