import Data.Functor

main :: IO()
main = getContents >>= mapM_ (print . length . show . sum) . (mapMap read . wordsLines)

wordsLines :: String -> [[String]]
wordsLines = map words . lines

mapMap :: (a -> b) -> [[a]] -> [[b]]
mapMap f = map (map f)
