#include
#include
using namespace std;
int main(){
int n;
cin>>n;
int res[1000];
int resSize;
res[0]=1;
int carry=0;
int x=2;
while(x<=n){
for(int i=0;i<resSize;i++){
int prod=res[i]*x + carry;
res[i]=prod%10;
carry=prod/10;
}
//check if there's carry left in the end
while(carry){
res[resSize]=carry%10;
carry=carry/10;
resSize++;
}
x++;
}
//print in reverse order
for(int i=resSize-1;i>=0;i--){
cout<<res[i];
}
}