num = int(input()) num = sum(range(num)) print(num)