fun main(args: Array<String>) {
    val n = readLine()?.toLong() ?: return

    var result = Int.MAX_VALUE

    for (a in 1..(Math.sqrt(n.toDouble()).toLong())) {
        if ((n % a) != 0L) {
            continue
        }
        val b = n / a
        val f = f(a, b)
        if (f < result) {
            result = f
        }
    }

    println(result)
}

private fun f(a: Long, b:Long): Int {
    var max = Math.max(a, b)
    var count = 0
    while (max >= 1) {
        max /= 10
        count++
    }
    return count
}