from math import factorial N=int(input()) print(str(factorial(N))[-12:]if N<50 else"0"*12)