Each sheep has 4 legs and each chicken has 2 legs. If I count 50 heads and 140 feet total, how many sheep are there?

Answer:
[tex]20\:\mathrm{sheep}[/tex]
Step-by-step explanation:
We can write the following system of equations:
[tex]\begin{cases}2c+4s=140,\\c+s=50\end{cases}[/tex], where [tex]c[/tex] is the number of chickens and [tex]s[/tex] is the number of sheep.
Multiply the second equation by [tex]-2[/tex] and add both equations to solve for [tex]s[/tex]:
[tex]\begin{cases}2c+4s=140,\\-2c-2s=-100 \end{cases},\\2s=40,\\s=\fbox{$20$}[/tex].