package no500; import java.util.Scanner; public class Main { public static long MOD = 1000000000000L; public static void main(String[] args) { Scanner sc = new Scanner(System.in); long n = sc.nextLong(); n = Math.min(n, 1000); long fact = 1; boolean of = false; long fact2 = 1; for(int i=1;i<=n;i++) { fact = fact * i % MOD; fact2 = fact * i; if (fact2 >= MOD) { of = true; } } if (of) { System.out.println(String.format("%012d", fact)); }else{ System.out.println(fact); } } }