$n=<>;0while$_++,$n=$n&1?$n*3+1:$n/2,$n>1;print