import java.util.*; public class Main { static final long MOD = 1000000000000L; public static void main (String[] args) throws Exception { Scanner sc = new Scanner(System.in); long n = sc.nextLong(); if (n < 100 && kaijo(n) != 0) { System.out.println(kaijo(n)); } else { System.out.println("000000000000"); } } static long kaijo (long x) { if (x <= 1) { return 1; } else { return x * kaijo(x - 1) % MOD; } } }