log = console.log;

var stdin = require("fs").readFileSync("/dev/stdin", "UTF-8");
// var lines = stdin.split("\n");
var N = Number(stdin);
var rootN = Math.ceil(Math.sqrt(N));

answers = [];
for (var A = 1; A <= rootN; A++) {
  if (N % A === 0) {
    var B = N / A;
    var F = Math.max(A.toString().length, B.toString().length);
    answers.push(F);
  }
}

log(Math.min(...answers));
