N=int(input()) res=1 for i in range(N): res*=i+1 if res%1000000000000==0: print("000000000000") exit() print(res%1000000000000)