# your code goes here
#step
N=int(input())
if N>=60:
    print("000000000000")
else:
    S=1
    for i in range(1,N+1):
        S*=i
        if S>999999999999:
            S=str(S)
            S=S[-12:]
            S=int(S)
    print(S)