n = int(raw_input()) a = 1 b = 1 while b <= n and a != 0: a *= b a %= 10**12 b += 1 if a == 0: print '0'*12 else: print a