  function Main(input){
	input=input.trim().split("\n");
	var N = parseInt(input,10);
	var array = [];
	var tmp = N;
	var k = 2;
	division_loop:
	while (true) {
		if (tmp % k == 0){
			tmp = tmp / k;
			array.push(k);
		} else {
			if (k > Math.sqrt(tmp)) {
				array.push(tmp);
				break division_loop;
			}
			k++;
		}
	}
	var ans = F(F_Comparison(array,N));
	console.log(ans);
}

function F(x){
	var i = 1;
	var j = 1;
	while(true){
		j *= 10;
		if (x >= j){
			i++;
		} else {
			return i;
			break;
		}
	}
}

function F_Comparison(array, N){
	var nYakusu = array.length;
	var zeroOneArray = [];
	var tmpValue = 1;
	var candidate = 1;
	for (var i = 0; i < Math.pow(2, nYakusu); i++){
		for (var j = 0; j < nYakusu; j++){
			if ((i / (Math.pow(2, j)) | 0) % 2 === 1) {
				tmpValue *= array[j];
			}
		}
		if (tmpValue > candidate && tmpValue <= Math.sqrt(N)){
			candidate = tmpValue;
		}
        tmpValue = 1;
	}
	return N / candidate;
}


Main(require("fs").readFileSync("/dev/stdin", "utf8"));
