Answer: Farmer Doug counts 2 chickens and 5 pigs.
Explanation:
Let x be the number of chickens and y be the number of pigs.
Since a chicken has 2 legs and a pig has 4 legs
According to the question , we have two equations :-

Divide 2 on both sides in equation (2), we get

Now, Subtract equation (1) from (3), we get

Put y=5 in (1) , we get

Hence, Farmer Doug counts 2 chickens and 5 pigs.