f :: (Show a1, Show a2) => a1 -> a2 -> Int
f a b = max (length (show a)) (length (show  b))

main :: IO ()
main = do
  n <- readLn
  let xs = [f x (div n x) | x <- [1..10^5], n`mod`x == 0]
  print $ foldr1 min xs
