import math if __name__ == '__main__': n = int(input()) fact = math.factorial(n) display = fact % (10 ** 12) x = math.floor(math.log10(fact)) print(display if x < 12 else '{0:012d}'.format(display))