import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); long N = sc.nextLong(); long Z = 1; long mod = (long)Math.pow(10,12); for(int i=1; i<=N; i++){ Z*=i; Z%=mod; if(Z==0){ System.out.println("000000000000"); System.exit(0); } } System.out.println(Z); } }