function Main(input){
  input = input.split('\n');
  var N = Number(input[0]);
  var result = 10**10;
  for(var a=1;a<=N;a++){
    var b = N/a;
    var tmp = String(b).length<String(a).length?String(a).length:String(b).length;
    if(result>tmp){
      result = tmp;
    }

  }
  console.log(result);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));