import scala.annotation.tailrec
import scala.io.StdIn

object Main extends App {

  @tailrec
  def rec(acc:Long, num:Long):Long = {
    if(num == 0L) acc
    else rec(acc+1L, num/10L)
  }

  val n =StdIn.readLong
  val r = math.sqrt(n).toLong
  val ans = (2L to r)./:(rec(0, n))((acc,i) => {
    if(n % i == 0L) math.min(acc, rec(0, n/i))
    else acc
  })
  println(ans)
}