To find how many chose hamsters, birds, or fish we first verified that the sum of all the percentages is 100% to check that the citizens answered just one time each one.
We have that 17+22+21+27+7+6 = 100.
Now hamsters, birds, or fish is an union of the people that answered this is a sum 6+21+17 = 44 in this case because the events are independients this means the intersection is empty. So the answer is 44.