function main(lines) {
    const input = lines-0
    var output = []
    for(var i=1; i*i<= input; i++){
        const a = input/i
        const b = input/a
        output.push( Math.max(a.toString().length, b.toString().length) )
    }
    const result = output.sort(function(a,b){return a-b})[0] 
    console.log(result)
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'));

