Twenty four teams are divided into 4 groups of six teams each. Within each group the teams play each other exactly once. The winners of each group then play in the semi-finals. Winners of the semi-finals play in the finals and losers for the 3rd place. How many matches are played?