$n=<>;$n=$n%2?3*$n+1:$n/2,++$%while$_[$n]=$n-1;print$%,$/,$#_