s = gets.to_i
array = []
index = 1
loop do
    if array.include?(s) then
        break
    else
        array.push s
    end
    index += 1
    if s.even? then
        s = s/2
    else
        s = 3*s+1
    end
end
puts index