fact :: Int -> Int fact n = fact' n 0 fact' 0 m = m fact' n m = fact' (n - 1) (m + n) main = getLine >>= print . fact . read