s = gets.to_i

current_number = s
past_numbers = [current_number]
(1..1000000).each.with_index(2) do |num, i|
  next_num = current_number.even? ? current_number / 2 : 3 * current_number + 1
  if past_numbers.include?(next_num)
    puts i
    break
  end
  past_numbers << next_num
  current_number = next_num
end