n = gets.to_i
until n == 0
    count = 0
    while n != 1
        if n % 2 == 0
            n /= 2
            count += 1
        elsif n % 2 == 1
            n *= 3
            n += 1
            count += 1
        end
    end
    puts count
    n = gets.to_i
end
