In a society of 30 people, any two people are either friends or enemies, and everyone has exactly six enemies. How many ways are there to choose three people from the society so that any two of them are either all friends or all enemies?
From 30 people, we can choose 3 in $\binom{30}{3}=4060$ different ways. In a selected trio, either everyone is an enemy to everyone else, or everyone is a friend to everyone else, or two are friends and these two are enemies of the third, or two are enemies and they are friends of the third.

Notice that in the last two cases, exactly two of the three people have both a friend and an enemy in the given trio, while in the first two cases, there is no such person. Therefore, the number of unfavorable trios can be calculated by seeing how many ways we can choose one person and then a friend and an enemy for that person. In this way, each unfavorable trio is counted twice, since there are two such people in each unfavorable trio.

Each person has 6 enemies and 23 friends, so with one person, we can pair a friend and an enemy in $6 \cdot 23=138$ ways. Since there are 30 people, the number of unfavorable trios is

$$
\frac{30 \cdot 138}{2}=2070
$$

Thus, the number of favorable trios is $4060-2070=1990$.

Remark. Generally, if there are $n$ people and these people have $e_{1}, e_{2}, \ldots, e_{n}$ enemies respectively, then similarly we obtain that the number of trios in which everyone is a friend to everyone else or everyone is an enemy to everyone else is

$$
\binom{n}{3}-\frac{\sum_{i=1}^{n} e_{i}\left(n-1-e_{i}\right)}{2}
$$

Based on the work of Csörnyei Mariann (Fazekas M. Fóv. Gyak. Gimn., II. o. t.)