import Control.Applicative

maxAB :: Int -> Int -> Int
maxAB n a =
   if n `div` a < a
      then a
      else n `div` a

findNumList :: Int -> [Int]
findNumList n = [maxAB n x | x <- [1..n], n `mod` x == 0]

digits :: Int -> Int
digits = length . show
get_max_digits list =  digits $ maximum list

main :: IO ()
main = do
   n <- readLn
   let result = minimum $ findNumList n
   print $ digits result
