solve :: (Int, Int) -> Int
solve (a, b) = max la lb
  where la = length $ show a
        lb = length $ show b

main :: IO ()
main = do
  n <- readLn
  let x = floor . sqrt $ fromIntegral n
  print . minimum $ solve <$> [(a, n `div` a) | a <- [1..x], n `mod` a == 0]