import qualified Data.ByteString.Char8 as C
import Data.Maybe ( fromJust )

import Data.Numbers.Primes (primeFactors)
import Data.List (reverse)

cReadLn :: IO Int
cReadLn = fst . fromJust . C.readInt <$> C.getLine

main :: IO ()
main = do
  n <- cReadLn
  print $ f n

minPair :: Int -> (Int,Int)
minPair n = h ps (1,1)
  where
    ps :: [Int]
    ps = reverse . primeFactors $ n

    h :: [Int] -> (Int,Int) -> (Int,Int)
    h []     ab   = ab
    h (p:ps) (a,b)
      | pa <= b   = h ps (pa,b)
      | otherwise = h ps (a, p*b)
      where
        pa = p*a
    
f = length . show . snd . minPair