print(sum([range(int(input()))]))