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