Question 892096
a = total number of animals

A farmer said: “I only have sheep, goats and horses.
a = s + g + h  
 In fact, right now the number of animals minus the number of sheep is 3,
a - s = 3
we can rewrite this  to:
s = a - 3
:
 the total minus the number of goats is 4
a - g = 4
g = a - 4

 and the total minus the number of horses is 5
a - h = 5
h = a - 5
:
 s + g + h = a
Replace s, g, h
(a-3) + (a-4) + (a-5) = a
3a - 12 = a
3a - a = 12
2a = 12
a = 6 animals
:
You can use the above equations now to find the number of each animal