N=int(input()) n=0 for i in range(0,N): n+= i print(n)