def f(s)
    if s.even? then
        s/2
    else
        (3*s)+1
    end
end

c=1
ary = []
s = gets.to_i
1000000.times do |i|
    ary.push(s)
    s=f(s)
    c+=1
    if ary.include?(s) then
        break
    end
end

puts c