N = int(input()) ans = 1 for n in range(1,N + 1): ans = (ans * n) % (10 ** 13) if ans == 0: break if ans > 0: print(ans) else: print("000000000000")