local function f(n)
    if n % 2 == 0 then
        return n / 2
    else
        return 3 * n + 1
    end
end
local prev = io.read("n")
local appeared = {}
appeared[prev] = true
for m=2,1000000 do
    local a = f(prev)
    if appeared[a] then
        print(m)
        return
    else
        appeared[a] = true
        prev = a
    end
end