fun main(args: Array<String>) {
    val N = readLine()!!.toLong()


    val sqrtN = Math.sqrt(N.toDouble()).toLong()

    // log_10(x)
    fun digits(x: Long) : Int {
        var num = x
        var count = 0
        while (num > 0) {
            num /= 10
            count++
        }
        return count
    }

    fun F(A: Long, B: Long) : Int {
        return Math.max(digits(A), digits(B))
    }

    var answer = Int.MAX_VALUE
    // O(N^0.5 * log_10 N)
    (1..sqrtN).forEach { A ->
        if (N % A == 0L) {
            val B = N / A
            answer = Math.min(answer, F(A, B))
        }
    }
    println(answer)
}
