In a local basketball league championship total 198 games were played, where each team played exactly three games with all the other teams. How many teams participated in this championship?