s = gets.to_i
@memo = Hash.new(0)

def func(n,i)
    return i if @memo[n] == 2
    return func(n,i+1) if i == 0
    if n.even?
        n = n/2
    elsif n.odd?
        n = (3*n)+1
    end
    return func(n,i+1) if @memo[n] += 1
    return @memo[n] = func(n,i+1)
end

puts func(s,0)