In the annual football league of a certain middle school, it is stipulated that each team must play one match against every other team. If in the 2012 season all teams played a total of 21 matches. Then the number of participating teams is: