Daniel raises some ducks and dogs. All the ducks and dogs have $18$ legs and $5$ pairs of wings in total. If all the ducks and dogs each lift one leg off the ground, how many legs do they lift in total? Let's think step by step and output the final answer within \boxed{}.
user