using System; using System.Numerics; namespace FactCalc { class Program { static void Main(string[] args) { BigInteger n = BigInteger.Parse(Console.ReadLine()); BigInteger f = Ncalc(n); Console.WriteLine( Formater(f) ); } private static string Formater(BigInteger f) { string s = f.ToString("#"); if (s.Length > 12) { s = s.Substring(s.Length - 12, 12); } return s; } private static BigInteger Ncalc(BigInteger n) { if( n < 50 ) { for (BigInteger i = n - 1; i > 1; i--) { n *= i; } } else { n = 1000000000000; } return n; } } }