main = do
  n <- readLn :: IO Int
  print $ minimum $ solve n 1 

solve :: Int -> Int -> [Int]
solve n a
  | n == 1 = [1]
  | a*a >= n = []
  | n `mod` a /= 0 = solve n (a+1)
  | otherwise = mab : solve n (a+1)
     where
       mab = max (len a) (len b)
       b = n `div` a
       len = length . show
