s = gets.to_i
arr = []
i = 1
loop do
    if arr.include?(s) then
        puts i
        break
    end
    arr.push(s)
    if s % 2 == 0 then
        s = s / 2
    else
        s = s * 3 + 1
    end
    i = i + 1
end