Sarah is planning a party and needs to buy drinks and snacks. She decides to buy soda and chips. Each can of soda costs $2 and each bag of chips costs $3. If Sarah spends a total of $30 on drinks and snacks and buys 10 bags of chips, how many cans of soda did she buy?