fun main(args: Array<String>) {
    var numN =  readLine().orEmpty().toLong()
    val sqrtN = Math.sqrt(numN.toDouble()).toLong()

    val listA = mutableListOf<Long>()

    for(i in 1L until sqrtN + 1){
        if(numN % i == 0L){
            listA.add(i)
        }
    }

    var dist = numN
    var result = 1L
    listA.distinct().forEach {
        if(Math.abs(it - (numN / it)) < dist){
            dist = Math.abs(it - (numN / it))
            result = it
        }
    }

    
    println(digit(result,numN / result))

}


//桁数の大きい方の値
fun digit(a:Long,b:Long):Int{
    val digitA = a.toString().length
    val digitB = b.toString().length

    return if (digitA < digitB) digitB else digitA
}