# Your code here!

nums = Array.new(1000000){0}
n = gets.to_i

i=0

while(1) do
    i+=1
    if(nums[n]>0)
        break
    else
        nums[n]+=1
        if(n%2==0)
            n/=2
        else
            n = 3*n+1
        end
    end
end

puts i