$5$ pairs of wings means there are $5$ ducks, so there are $18-5\times2=8$ legs for dogs, which is $8\div4=2$. Thus, there are $2+5=7$ animals. 
Daniel raises some ducks and dogs. All the ducks and dogs have $18$ legs and $5$ pairs of wings in total. How many ducks and dogs are there in total? 
1: $$18$$ 
2: $$13$$ 
3: $$9$$ 
4: $$7$$ 
5: $$5$$ 