import Data.Char(digitToInt) persistence :: Int -> Int persistence n | n < 10 = 0 | otherwise = 1 + persistence (product $ map digitToInt $ show n)