s = gets.to_i
hash = {}
hash[s] = true

ans = 2
loop do
    if s%2 == 0
        s /= 2
    else
        s = 3*s+1
    end
    if hash[s]
        puts ans
        exit
    end
    hash[s] = true
    ans += 1
end