$[$ Processes and Operations $]$ [ Evenness and Oddness $]$

Dwarves sat down at a round table and voted on many issues. For each issue, they could vote "for", "against", or abstain. If both neighbors of a dwarf chose the same option on a particular issue, then for the next issue, the dwarf would choose the same option. If the neighbors chose two different options, then for the next issue, the dwarf would choose the third option. It is known that on the issue "Does gold shine?" all dwarves voted "for", and on the issue "Is the Dragon scary?" Thorin abstained. How many dwarves could there be?
If the gnomes voted unanimously on any issue, they will always vote the same way after that. Therefore, the question about the Dragon was discussed before the question about the gold.

It is possible that before the question about the gold, the gnomes had already voted "for" several times unanimously. Consider the last question where there was a dissenting gnome (voted "against"; such a question existed, for example, the question about the Dragon). Let this gnome vote "against." For his neighbors to vote "for" the next time, the gnomes sitting one apart from him must have abstained. Similarly, the gnomes sitting one apart from them must have voted "against," and so on. We get a chain ...A?B?A?B?..., where "A" and "B" represent those who voted "against" and abstained, and the question marks represent gnomes whose opinions do not interest us. If the dissenting gnome abstained, we get a similar chain.

If the number of gnomes is even, the chain will close, which means there will be an equal number of "B" and "A." Then the number of gnomes marked "B" and "A" is even, and the total number of gnomes is twice as much.

If the number of gnomes is odd, then by placing "B" and "A" in a circle, we will continue to place them instead of question marks, that is, the gnomes will be arranged in pairs around the circle: ...BBAA BBAA... This contradicts the fact that their number is odd.

It remains to show by example that any number of gnomes divisible by 4 satisfies the condition of the problem. For this, let them vote on the Dragon as follows: ...BBAA BBAA... (one of the "B" is Thorin), and then vote unanimously "for" on the gold.

## Answer

Any number divisible by 4.