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