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