import java.io.*; import java.util.*; public class Main_yukicoder500 { private static Scanner sc; private static Printer pr; private static void solve() { long n = sc.nextLong(); if (n > 100) { pr.println("000000000000"); } else { long ret = 1; boolean flag = false; for (int i = 2; i <= n; i++) { ret *= i; if (ret >= 1_000_000_000_000L) { ret %= 1_000_000_000_000L; flag = true; } } if (flag) { pr.printf("%012d\n", ret); } else { pr.println(ret); } } } // --------------------------------------------------- public static void main(String[] args) { sc = new Scanner(System.in); pr = new Printer(System.out); solve(); pr.close(); sc.close(); } private static class Printer extends PrintWriter { Printer(PrintStream out) { super(out); } } }