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