n = int(input()) def fact(m): p = 1 for i in range(m): p *= i+1 return p if n > 50: print("0"*12) else: print(str(fact(n))[-12:])