Rashad had ducks and cows on his farm. These 14 animals had a total of 40 legs. How many cows and ducks were there?