N = int(input()) import math if N >= 50: print('0'*12) else: print(str(math.factorial(N))[-12:])