A pizza shop sold 18 medium pizzas. The number of large pizzas sold was 3 times as many as the number of medium pizzas sold. How many pizzas did the pizza shop sell altogether?