import math print str(math.factorial(min(50,input())))[-12:]