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