N=int(input()) f=1 for i in range(1,N+1): f*=i f%=10**12 if f==0: print("000000000000") exit() print(f)