import math n = int(input()) if n <= 14: print(math.factorial(n)) elif 14 < n < 50: print(str(math.factorial(n))[-12:]) else: print('0'*12)