main = do
    n <- readLn
    let divn = maximum $ divisors n
    print $ digit $ max divn $ div n divn

intSqrt n = truncate . sqrt $ fromIntegral n

divisors n = [x | x <- [1..intSqrt n], mod n x == 0]

digit n = length $ show n