import System.Environment fact :: Integer -> Integer fact n = fact' n 0 fact' 0 m = m fact' n m = fact' (n - 1) (m + n) main = getArgs >>= print . fact . read . head