program ABC116B
    implicit none
    integer(8)::i=2
    integer(8)::j
    integer(8)::flg=0
    integer(8),dimension(1000000)::A

    read(5,*)A(1)

    do
        if(mod(A(i-1),2)==0)then
            A(i)=A(i-1)/2
        else
            A(i)=3*A(i-1)+1
        end if

        do j=1,i-1
            if(A(j)==A(i))then
                flg=1
                exit
            end if
        end do

        if(flg==1)then
            exit
        end if

        i=i+1
    end do
    
    print'(i0)',i

end program ABC116B