def factorial(n): if n == 1: return 1 else: return n * factorial(n-1) N = int(input()) Nf = factorial(N) if Nf >= 10**12: Nf_l = list(str(Nf)) s = "" for i in range(-12,0): s += Nf_l[i] print(int(s)) elif Nf < 10**12: print(Nf)