s = STDIN.readline.to_i

exists = {}
i = 1
while not exists.has_key?(s) do
    exists[s] = i
    if s.modulo(2) == 0 then
        s = s / 2
    else
        s = 3 * s + 1
    end
    i += 1
end
puts(i)