using System; using System.Linq; using System.Collections.Generic; namespace yukicoder { class pg { static void Main(string[] args) { long N = long.Parse(Console.ReadLine()); long ans = 1; long mod = 1000000000000; bool modSwitch = false; for(long i = 1;i <= N;i++) { ans *= i; if(ans > mod) { modSwitch = true; ans %= mod; } if(ans == 0) { Console.WriteLine("000000000000"); return; } } if(modSwitch) { Console.WriteLine(ans.ToString("d12")); }else { Console.WriteLine(ans); } } } }