A community center sells a total of 299 tickets for a basketball game. An adult ticket costs ​$4. A student ticket costs ​$1. The sponsors collect ​$587 in ticket sales. Find the number of each type of ticket sold.