# include<iostream> using namespace std; int main(){ int j; cin>>j; int n=1; for(int i=0;i<=j-2;i++){ n=n+i; } cout<<n; return 0; }