read a
j=2
echo $a > list 
for i in `seq 2 1000000`; do
	if [ $(($a%2 )) == 0 ]; then
    	a=$(($a/2))
    else
    	a=$(($a*3+1))
    fi    
echo $a >> list
sort list | uniq -d > list1
	if [ -s list1 ]; then
		echo $j
    	break 2
	else
		j=$((j+1))
	fi
done