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