import java.util.Scanner; public class No500 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); long N = sc.nextLong(); long result = 1; for(long i = 1;i <= N;i++) { result = result * i; String str = String.valueOf(result); if(str.length() > 12) { str = str.substring(str.length() - 12,str.length()); } result = Long.parseLong(str); } System.out.println(String.format("%012d", result)); } }