a = gets
 
numbers = [a]
value = false
b = a
sum = 1

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