n = map(int, raw_input()) sum = 0 for I in range(1, n, 1): sum += i print sum