object Main extends App {
  import scala.math._
  
  def F(a:Long,b:Long) = {
    Array(a.toString.length,b.toString.length).max
  }
  
  val n = readLong
  
  println((for (a <- 1 to sqrt(n).ceil.toInt if n % a == 0; b = n / a) yield F(a,b)).min)
}