def options (a): sum = 0 for x in range(a): sum = sum + x return sum inp = input() print(options(int(inp)))