import java.util.*; public class Main { static final long MOD = 1000000000000L; public static void main (String[] args) { Scanner sc = new Scanner(System.in); long n = sc.nextLong(); long ans = 1; boolean isMod = false; for (int i = 0; i < n && ans > 0; i++) { ans *= i + 1; if (!isMod && ans >= MOD) { isMod = true; } if (isMod) { ans %= MOD; } } if (isMod) { System.out.printf("%012d\n", ans); } else { System.out.println(ans); } } }