s=gets.to_i
a=[s]
def f(n)
    if n%2==0
        return n/2
    else
        return 3*n+1
    end
end

for i in 1..1000000
    ne=f(a[i-1])
    if a.include?(ne)
        p i+1
        break
    else
        a<<ne
    end
end