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

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

