a = gets
 
numbers = [a]
 
value = false

sum = 1

until value
  if a % 2 == 0
    sum += 1
    a = a / 2
    numbers.push(a)
    numbers.each do |number|
      if number == a
        value = true
        puts sum
      end
    end
  else
    sum += 1
    a = a * 3 + 1
    numbers.push(a)
    numbers.each do |number|
      if number == a
        value = true
        puts sum
      end
    end 
  end
end
