import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); long n = sc.nextLong(); if (1000000 <= n) { System.out.println("000000000000"); } else { long mod = 1000000000000L; long ans = 1; boolean flag = false; for (int i = 1; i <= n; i++) { ans *= i; if (ans >= mod) { flag = true; } ans %= mod; } if (flag) { System.out.println(String.format("%012d", ans)); } else { System.out.println(ans); } } } }