num_degit n =truncate $ log n / log 10 +1

main = do
  n <- getLine >>= return . read :: IO Int
  let a = minimum [num_degit $ fromIntegral (maximum [a,div n a]) |a<-[1..(truncate ( sqrt $ fromIntegral n))],(n `mod` a)==0]
  print a