module Main where

import Control.Applicative
import Control.Monad

main :: IO ()
main = do
    pairs <- map (map read . words) . lines <$> getContents :: IO [[Int]]
    forM_ pairs $ \(a:b:_) -> print $ length $ show $ a + b