Hayden decided to take martial arts classes at his local gym. He pays $35 each month for his membership and $12 for every class he takes. in august, hayden paid a total of $107. how many classes did he take?