n = input() mod = 1000000000000 ans = 1 for i in range(1, n + 1): ans *= i tmp = ans % mod print "{0:012d}".format(tmp)