s = gets.chomp.to_i
arr = Array.new

arr.push(s)

while true
    if s % 2 == 0
        s = s / 2
    else
        s = 3 * s + 1
    end
    
    if arr.include?(s)
        arr.push(s)
        break
    end
    arr.push(s)
end

puts arr.size