def fx(N): n=N for i in range(2,N): n *=i return (str(n)[-12:]) N=int(input()) if N>49: print("0"*12) else: print(fx(N))