4. (8 points) There are 2012 dwarfs, who are either good or bad. Every day, they attend a gathering, with the number of participants being 3 or 5. In each gathering, if the majority are good dwarfs, all participants become good; if the majority are bad dwarfs, all participants become bad. If by the end of the third day's gathering, all 2012 dwarfs have become good, then the minimum number of good dwarfs before the first day's gathering is $\qquad$ .
【Solution】Solution: Backward reasoning: Extreme analysis, to make the number of good people as few as possible, the number of bad people turning into good people should be maximized during the gathering.

If in groups of three, the maximum number of people turning into good is $\frac{1}{3}$; if in groups of five, the maximum number of people turning into good is $\frac{2}{5}$; $\frac{2}{5}>\frac{1}{3}$, so we should try to form groups of five.
$$
2012=5 \times 400+3 \times 4,
$$

So the last gathering consists of 400 groups of 5 people and 4 groups of 3 people;
In each group of 5, 3 people are good, and in each group of 3, 2 people are good;
After the second gathering, the minimum number of good people is $400 \times 3+2 \times 4=1208$ (people);
Similarly, $1208=5 \times 241+3 \times 1$;
After the first gathering, the minimum number of good people is $241 \times 3+2=725$ (people), $725=145 \times 5$;
$$
145 \times 3=435 \text { (people); }
$$

Therefore, the answer is: 435.