import qualified Data.Vector.Unboxed as VU

divisor :: Int -> Int -> VU.Vector (Int, Int)
divisor n i
    | n < i*i = VU.empty 
    | n `mod` i == 0 =
        if i*i /= n then
            VU.cons (i, n `quot` i) $ divisor n (i+1)
        else
            VU.cons (i,i) $ divisor n (i+1)
    | otherwise = divisor n (i+1)

main = do
    x <- readLn :: IO Int
    let res = VU.minimum $ VU.map (\(a,b) -> max (length $ show a) (length $ show b)) $ divisor x 1
    print res