There are 45 chickens and rabbits, 146 counting legs, 28 caged chickens and 17 rabbits,

There are 45 chickens and rabbits, 146 counting legs, 28 caged chickens and 17 rabbits,

Suppose there are x chickens
2x+4(45-x)=146
We get x = 17
45-17=28
A: there are 17 chickens and 28 rabbits