def fx(N): n=N for i in range(2,N): n *=i return (str(n)[-12:]) N=int(input()) print(fx(min(N,50)))