module Main where
 
import Control.Applicative
import Control.Monad
import Data.List
import Data.Array

digits :: Integer -> Integer
digits x
  | x > 9 = 1 + (fromIntegral $ digits (x `div` 10))
  | otherwise = 1
dd [a, b] = digits $ a + b
-- dd [a, b] = (digits a, digits b)

main :: IO ()
main = do
    ns <- fmap (fmap (read :: String -> Integer) . words) . lines <$> getContents
    forM_ [0..length ns-1] $ \i -> do
      putStrLn $ show $ dd (ns!!i)