import Control.Applicative ((<$>))

main = do
  n <- read <$> getLine :: IO Integer
  let f a b = max c d
            where c = (length.show) a
                  d = (length.show) b
  print $ minimum [f a b|a<-[1..(ceiling.sqrt.fromIntegral) n],let (b,m)=n`divMod`a,m==0]
