countDigit :: [Int] -> Int
countDigit ns = length $ show $ (foldl (+) 0 ns)

count :: String -> String
count s = show $ countDigit $ map read (words s)

main :: IO ()
main = interact (unlines . (map count) . lines)