You will need to set up s system of equations for this problem.
You know there are 18 animals so
Let x=cow and y= chick
x + y = 18
Thenconsider the number of legs each has and the total number of legs.
4x + 2y = 50
Solving the system you get 11 chickens and 7 cows