import Control.Applicative
import Control.Monad
import Data.List

f :: Int -> Int -> Int
f a b = max (length $ show a) (length $ show b)

main :: IO ()
main = do
    n <- readLn :: IO Int
    let a1 = do
        s <- [1 .. floor (sqrt (fromIntegral n))]
        guard $ n `mod` s == 0
        return s
    let a2 = fmap (\d -> f d (n `div` d)) a1
    print $ minimum a2