#include<bits/stdc++.h> using namespace std; int main(){ int n,a=1; cin>>n; for(int i=0;i<=n-2;i++) a+=i; cout<<a<<endl; return 0; }