a=1
read b
min=$(echo -n $b|wc -c)
factor $b|cut -d' ' -f 2-|tr ' ' '\n'|while read line
do
    ((a*=$line))
    ((b/=$line))
    fa=$(echo -n $a|wc -c)
    fb=$(echo -n $b|wc -c)
    t=$((($fa>$fb?$fa:$fb)))
    echo $t
done|sort -n|head -1
