N = int(input()) ans=1 for i in range(1, N+1): ans*=i if ans%(10**12)==0: break if ans==0: print("0"*12) else: if ans>=10**12: print("0"*(12-len(ans%(10**12))), end="") print(ans%(10**12))