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