read a b=`factor $a|sed 's/ 2 / /g'|awk '{print $2}'` if [ $(( $a % 4 )) -eq 0 ]; then b=$(( $b > 4 ? 4 : $b )) fi echo $b