#include<iostream> #include<cstdio> #include<cmath> using namespace std; int main(){ long long n,N; cin>>n; N=(n*(n-3))/2; cout<<N; return 0; }