main = readLn >>= print . digits

isqrt :: Integral a => a -> a 
isqrt = floor . sqrt . (fromIntegral :: Integral a => a -> Double) 

digits :: Int -> Int
digits n = max (length (show dmax)) (length (show (div n dmax)))
  where
    dmax = maximum $ filter (\d -> mod n d == 0) cands
    cands = [1 .. isqrt n]