dividers::Int ->[Int]
dividers n = filter (\x-> (mod n x ) == 0 ) [1..(truncate (sqrt (fromIntegral n)))]

able::Int -> [(Int,Int)]
able n = [(i ,div n i)|i<-dividers n]

dig::Int -> Int
dig x = length (takeWhile (\y->x>=y) [ 10^i |i<-[0..]])

solver::Int -> Int
solver n =  minimum (map (\(x,y)-> dig (max x y)) (able n))

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