n = int(input()) if n >= 60: print('0'*12) else: ans = 1 for i in range(1, n+1): ans *= i ans %= 10**12 print(ans)