using System; using System.Collections.Generic; using System.Linq; namespace yukicoder { public class Program { public static void Main() { var n = int.Parse(Console.ReadLine()); if (n < 60) { Console.WriteLine(factorial(n)); } else { Console.WriteLine("000000000000"); } } static long factorial(int a) { long f = 1; while (a > 0) { f *= a; f %= (long)Math.Pow(10, 12); a--; } return f; } } }