from math import factorial n=int(input()) if n<=100: ans=[] for i in range(min(len(str(factorial(n))),12)): k=str(factorial(n)) ans.append(k[-(i+1)]) ans=ans[::-1] ans="".join(ans) print(ans) if n>100: print("0"*12)