prime_factors :: Int -> [Int]

prime_factors 1 = []
prime_factors n
  | factors == []  = [n]
  | otherwise = factors ++ prime_factors (n `div` (head factors))
  where factors = take 1 $ filter (\x -> (n `mod` x) == 0) [2 .. n-1]

divide::[Int]->(Int,Int)->(Int,Int)
divide [] (a,b)=(a,b)
divide (x:xs) (a,b) = if a>=b then divide xs (a,b*x) else divide xs (a*x,b)

find_ab::Int->(Int,Int)
find_ab  n = let fac = reverse (prime_factors n) in
             divide fac (1,1)

dig::Int -> Int
dig x = (truncate (logBase 10.0 (fromIntegral x)))+1

solver::Int -> Int
solver n = let (a,b) =  find_ab n in max (dig a) (dig b)

main::IO()
main=do
  nc<-getLine
  print (solver (read nc))