
object Main extends App {

  val n = scala.io.StdIn.readLine().toLong

  def solve(): Long = {
    val sqrtN = Math.floor(Math.sqrt(n)).toInt
    (1 to sqrtN).foldLeft(Int.MaxValue) { case (acc, a) =>
      if(n % a == 0) {
        val b = n / a
        val tmpMax = maxDigit(a, b)
        Math.min(acc, tmpMax)
      } else acc
    }
  }

  def maxDigit(a: Long, b: Long) = {
    Math.max(a.toString.length, b.toString.length)
  }

  println(solve)

}