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