Julio goes the store and buys a total of 12 items. He is planning a party and purchases chips and popcorn. Each bag of chips costs $2 and each bag of popcorn costs $3. He spends a total of $30. How many of each did he buy?