s = gets.chomp.to_i

@log = []

@log << s

def hoge(n)
  if n % 2 == 0
    n = n / 2
  else
    n = (3 * n) + 1
  end
  return @log.size + 1 if @log.include?(n)
  @log << n
  hoge(n)
end


puts hoge(s)