a local restaurant offers a deal if you purchase 3 medium pizzas, you get 2 side dishes for free. If you get a total of 8 side dishes, how many pizzas did you buy?