main :: IO ()
main = do
    n <- readLn
    print $ solve n

solve :: Int -> Int
solve n = solve' n (round $ sqrt $ fromIntegral n)

solve' :: Int -> Int -> Int
solve' n a
    | r == 0 = f a q
    | otherwise = solve' n (a - 1)
    where (q, r) = n `divMod` a

f :: Int -> Int -> Int
f a b = maximum $ map (length . show) [a, b]
