#include<cstdio>
#include<iomanip>
#include<iostream>
#include<cstring>
#include<algorithm>
#include<math.h>
#include <string>
#include<cmath>
using namespace std;
int n,a[1000],b[1000],up,tmp,x,kaishi,kaishi2,changdu,up2,tmp2;
int main()
{
cin>>n;
a[0]=1;
for(int i=1; i<=n; i++)
{
for(int k=1; k<=i; k++)
{
up=0;
for(int j=0; j<=1000; j++)
{
tmp=a[j]*k+up;
a[j]=tmp%10;
up=tmp/10;
}
}
for(int i2=0; i2<=1000; i2++)
{
tmp2=a[i2]+b[i2]+up2;
b[i2]=tmp2%10;
up2=tmp2/10;
}
for(int j2=0; j2<=1000; j2++)
{
a[j2]=0;
}
}
for(int i=1000; i>=0; i--)
{ cout<<b[i];
kaishi2=i;
if(b[i]!=0)break;
}
for(int j=kaishi2; j>=0; j--)
{
cout<<b[j];
}
}