import math n = int(input()) print(str(math.factorial(n))[-12:])