n = input() print(sum([i for i in range(int(n))]))