def calc(num, counter)
    if(num == 1) then
        counter
    elsif(num % 2 == 0) then
        calc(num/2, counter+1)
    else
        calc(num*3+1, counter+1)
    end
end

while((num = gets.to_i) != 0) do
    puts calc(num, 0)
end