import math N = int(input()) ans = str(math.factorial(N)) if len(ans) > 12: ans = ans[len(ans)-12:] print(ans)