import math n=int(input()) print(math.factorial(n)%10**12if n<50else"0"*12)