#include<stdio.h>
#include<string.h>
int main()
{
    int n;
    int f[50];
    int i, j, s, c;
    while (scanf ("%d", &n)??EOF)
    {
        memset(f,0,sizeof(f));
        f[0]=1;
        for (i=2; i<=n; i++)
        {
            c=0;
            for (j=0; j<50; j++)
            {
                s=f[j]*i+c;
                f[j]=s%10;
                c=s/10;
            }
        }
        for (i=49; i>=0; i--) if (f[i]!=0) break;
        for (j=i; j>=0; j--) printf ("%d", f[j]);
        printf ("\n");
    }
    return 0;
}