import math n = int(input()) if n>=50: print("000000000000") else: ans = str(math.factorial(n)) if len(ans)>12: ans = ans[-12:] print(ans)