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 for which 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 abstain. Similarly, the gnomes sitting one apart from them must vote "against," and so on. We get a chain ...A?N?A?N?..., where "A" and "N" denote those who voted "against" and abstained, and the question marks denote gnomes whose opinion does 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 "N" and "A." Then the number of gnomes marked "N" and "A" is even, and the total number of gnomes is twice as much.

If the number of gnomes is odd, then by placing "N" 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: ...NNAAVVPP... . 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: ...NNAAVVPP... (one of the "N" is Thorin), and then vote unanimously "for" on the gold.

## Answer

Any number divisible by 4.
[ Processes and Operations ] [Evenness and Oddness]

Dwarves sat around a round table and decided many issues by voting. For each issue, they could vote "for", "against", or abstain. If both neighbors of a dwarf chose the same option for a certain 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 for the question "Does gold shine?", all dwarves voted "for", and for the question "Is the Dragon scary?", Thorin abstained. How many dwarves could there be?