Niu Niu needs to drive four black, white, gray and brown horses to cross the river. It takes 4 minutes for the black horse to cross the river, 6 minutes for the white horse to cross the river, 3 minutes for the gray horse to cross the river, and 9 minutes for the brown horse to cross the river. You can only drive two horses across the river, and ride another horse back. What is the minimum time it takes to drive four horses to the opposite bank?
牛牛要赶黑，白，灰，棕色的四匹马过河，黑马过河要4分钟，白马过河要6分钟，灰马过河要3分钟，棕马过河要9分钟，牛牛每次只能赶两匹马过河，再骑一匹马返回．要把四匹马赶到对岸，所花的时间最少是多少分钟？
<gadget id="calculator">4 + 3 + 9 + 4 + 4</gadget>
<output>24</output>

<result>24</result>