using System; using System.Collections.Generic; using System.Linq; class Program { static void Main(string[] args) { new Magatro().Solve(); } } public class Magatro { private long N = long.Parse(Console.ReadLine()); long Mod = 1000000000000; public void Solve() { if (N > 100) { Console.WriteLine(string.Format(new string('0', 12))); } else { long ans = 1; bool flag = false; for(long i = 1; i <= N; i++) { ans *= i; if (ans >= Mod) { flag = true; } ans %= Mod; } if (flag) { Console.WriteLine("{0:D12}", ans); } else { Console.WriteLine(ans); } } } }