In a state wide soccer competition, 36 games were played. Each team participating in the competition played once with every other team. How many teams were in the statewide competition?