#yuki_500 import math n=int(raw_input()) res=math.factorial(n) if res<10**12: print res else: res2=res%10**12 print "%012d" % res2