Write SQL query to solve given problem: How many teams in the NBA which has at least 3 all-star players?. Keep the solution inside sql tag ```sql [SQL-Query] ```
SELECT COUNT(*) FROM ( SELECT tmID FROM players_teams AS T1 INNER JOIN player_allstar AS T2 ON T1.playerID = T2.playerID WHERE T1.lgID = 'NBA' GROUP BY T1.tmID HAVING COUNT(DISTINCT T1.playerID) > 3 ) AS T3