n=int(input()) if n>100: print("000000000000") exit() def fact(n,mod=10**12): now=1 flag=False for i in range(2,n+1): now*=i if now >= mod: flag=True now%=mod return now,flag ans,flag = fact(n) if ans==0: print("000000000000") elif flag: print(str(ans).zfill(12)) else: print(ans)