main = input >>= return . factorial >>= output

input :: IO (Int)
input = getLine >>= return . read

output :: Int -> IO ()
output = putStrLn . show

factorial :: Int -> Int
factorial n = factorial' n 1
    where
    factorial' 1 r = r
    factorial' n r = factorial' (n-1) (n*r)