There are 52 chickens and goats in a barn. chickens have two legs, and goats have 4. 128 legs in total. How do set this up with substitution?

g = 52 - c

2c + 4g = 128

Substitute 52-c for g in the second equation and solve for c. Insert that value into the first equation to solve for g. Check by putting both values into the second equation.