divisor :: Int -> Int -> [(Int, Int)]
divisor n i
    | n < i*i = []
    | n `mod` i == 0 =
        if i*i /= n then
            [(i, n `div` i)] ++ divisor n (i+1)
        else
            [(i,i)] ++ divisor n (i+1)
    | otherwise = divisor n (i+1)


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