If my math skills are up to snuff, 7 cows.
7 cows + 2 chickens = 32 legs and 9 heads (9*2 + 14)
7 cows + 7 chickens = 42 legs and 14 heads (14*2 + 14)
Interesting enough, the number of chickens is meaningless.
That's what I got - but was worried my math skills were dusty and didn't want to post an incorrect answer since I've gotten two jokes today - without any help at all, from anyone!