Maria plans to rent a boat. The boat rental costs $58 per hour, and she will also have to pay for a water safety course that costs $12. Maria wants to spend no more than $350 for the rental and the course. If the boat rental is available only for a whole number of hours, what is the maximum number of hours for which Maria can rent the boat?