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 semifinals. Winners of semifinals. Winners of semifinals play in the finals and losers for the 3rd place. How many matches are played?