import Control.Applicative
import Control.Monad
import Data.List
import System.IO
import Text.Printf

infixl 0 `dot`
dot :: (c -> d) -> (a -> b -> c) -> a -> b -> d
dot = ((.).(.))

main :: IO ()
main = do
  e <- isEOF
  when (not e) $ do
    [a, b] <- map read . words <$> getLine
    print $ solve a b
    main

solve :: Int -> Int -> Int
solve = length . show `dot` (+)

