During a sale at the bookstore​, books sold for ​$4 and magazines sold for ​$3.50. Jan spent ​$29 and bought a total of 8 books and magazines. How many of each did she ​buy?