There are 5 cows and 15 hens.

Facts:
1) total of 20 animals
2) cows have 4 legs
3) hens have 2 legs
4) total of 50 legs
Using algebra let C be the number of cows and H be the number of hens.

Then set up these equations
  C +  H =  20
4C + 2H = 50

Alternatively, you could use trial and error. The number of cows has to be less than 13, because 13 or higher would exceed 50 legs.