'use strict';
console.log(function(args){
  const N = parseInt(args.trim(),10);
  let min = N.toString().length;
  for ( let A = 1; A*A <= N; A++ ) {
    if ( N % A !== 0 ) continue;
    const B = N / A;
    min = Math.min( min, B.toString().length );
  }
  return min.toString();
}(require('fs').readFileSync('/dev/stdin', 'utf8')));
