Mia owns a farm with sheep and ducks. Together, there are 50 animals. If the total number of legs is 140, how many sheep and ducks does Mia have on her farm? Let's think step by step and output the final answer within \boxed{}.
user