Problem 5.2. At first, the magical island was divided into three counties: in the first county lived only elves, in the second - only dwarves, in the third - only centaurs.

- During the first year, each county where non-elves lived was divided into three counties.
- During the second year, each county where non-dwarves lived was divided into four counties.
- During the third year, each county where non-centaurs lived was divided into six counties.

How many counties were there on the magical island after all these events?