#include int main(void){ long long int N,ans=1; scanf("%lld",&N); if(N<50){ for(;N>1;N--){ ans*=N; ans%=1000000000000; } printf("%lld\n",ans); } else { printf("000000000000\n"); } return 0; }