#include<cstdio>
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
vector<int> mul(vector<int>&A,int b)
{
int t=0;
vector<int>c;
for(int i=0;i<A.size()||t;i++)
{
t=t+A[i]*b;
c.push_back(t%10);
t/=10;
}
while(c.size()>1&&c.back()==0) c.pop_back();
return c;
}
vector<int> div(vector<int>&A,int b)
{
int t=0;
vector<int>c;
for(int i=A.size()-1;i>=0;i--)
{
t=t*10+A[i];
c.push_back(t/b);
t%=b;
}
reverse(c.begin(),c.end());
while(c.size()>1&&c.back()==0) c.pop_back();
return c;
} //n(n-1)(n-2)(n-3)/24
int main()
{
int n;
cin>>n;
if(n<=3)
{
cout<<"0";
return 0;
}
int x=n;
vector<int>A;
vector<int>c;
while(n)
{
A.push_back(n%10);
n/=10;
}
c=A;
for(int i=x-1;i>=x-3;i--)
{
c=mul(c,i);
}
c=div(c,24);
for(int i=c.size()-1;i>=0;i--) cout<<c[i];
return 0;
}