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