#include <cstdio>
const int MAX = ;
const int BASE = MAX;
int main()
{
int n, i, j;
while(~scanf("%d",&n))
{
int ans[]={}, left=MAX-, t=;
ans[MAX-]=;
for(i=;i<=n;i++)
{
for(j=MAX-;j>=left;j--)
{
ans[j] = ans[j]*i + t;
t = ans[j]/BASE;
ans[j] = ans[j]%BASE;
}
if(t)
{
left--;
ans[left]=t;
t=;
}
}
for(i=;ans[i]==;i++);
printf("%d",ans[i]);
for(i++;i<MAX;i++)
{
printf("%04d",ans[i]);
}
printf("\n");
}
return ;
}