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