4 shepherds were watching over their flocks and they were commenting on how many sheep they each had.
If David had three more sheep, then he'd have one less sheep than Harry.
Whereas Sam has the same number as the other three shepherds put together.
If Peter had three less sheep, he'd have exactly treble the number of David.
If they were evenly distributed they'd each have eleven sheep.
How many sheep did David have?
Let D = David's sheep H =Harry's sheep P = Peter's sheep S =Sam's sheep
We have these equations
D + 3 = H - 1 ⇒ D + 4 = H (1)
D + H + P = S (2)
P - 3 = 3D ⇒ 3D + 3 = P (3)
And the last statement means that
D + H + P + S = 44 (4)
Using (2) and (4) we have that
[D + H + P] = S so subbing this into (4) we have that
S + S = 44
2S =44
S = 22 = Sam's sheep
So
D + H + P = 22
And subbing (1) and (3) we have that
D + (D + 4) + (3D + 3) = 22
5D + 7 =22
5D = 15
D = 3 = David's sheep