In a pizzeria, you pay $7 for each of the first three pizzas, and $6 for the following pizzas. How many pizzas did Gerry's band buy, if they paid $45?