import Control.Applicative

digits :: Int -> Int
digits = length . show

f :: Int -> Int -> Int
f a b =
  if a < b
    then digits b
    else digits a

searcher :: Int -> Int
searcher n = minimum [f x (n `div` x) |  x <- [1..(n `div` 2)+1], n `mod` x == 0]

main = do
  n <- readLn
  print $ searcher n