#include
#include
int c[10086];
int main()
{
int i,j,l,n,k,h;
while(scanf("%d",&n)!=EOF)
{
memset(c,0,sizeof(c));
c[0]=1;
k=0;
if(n==0)
printf("1\n");
else
{
for(j=1;j<=n;j++)
{
for(i=0;i<=k;i++)
{
c[i]=c[i]*j;
}
for(h=0;h<=k;h++)
{
if(c[h]>9999)
{
c[h+1]=c[h+1]+c[h]/10000;
c[h]=c[h]%10000;
if(c[k+1]>0) //*为什么这个if判断不能少 按道理不是一定会有c[k+1]>0吗,没有这一句我的结果前面多了两个0*//
k++;
}
}
}
for(l=k;l>=0;l--)
{
if(l==k)
printf("%d",c[l]);
else
{
if(c[l]=0)
printf("000%d",c[l]);
else if(c[l]=10)
printf("00%d",c[l]);
else if(c[l]=100)
printf("0%d",c[l]);
else if(c[l]>=1000)
printf("%d",c[l]);
}
}
printf("\n");
}
}
return 0;
}