Write an equation and solve: A merchant bought six identical ceiling fans and then purchased three more. The total cost was $1,188. How much did each fan cost?