n=int(input()) c=1 ans=1 while c<=n: ans*=c c+=1 if str(ans)[-12:]=='0'*12:break print(str(ans)[-12:])