s = gets.chomp!.to_i

a = s
ans = {}
ans[a] = 1

def f(n)
    if n % 2 == 0
        n / 2
    else
        3 * n + 1
    end
end

count = 1
loop do
    a = f(a)
    count += 1
    if ans[a]
        puts count
        break
    else
        ans[a] = 1
    end
end

