#include long fac(int n){ if(n == 1){ return 1; }else{ return (fac(n-1)*n) % 1000000000000; } } int main(void){ long n; scanf("%ld", &n); printf("%ld\n", fac(n)); return 0; }