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