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?
There must be 44 sheep
Let the number of David's sheep = D
Then Peter's sheep - 3 = 3D or P = 3D + 3
And D + 3 = H -1 or Harry = D + 4
And Sam = D + 3D - 3 + D + 4
So
D + P + H + S = 44
So
D + (3D + 3) + (D + 4) + D + (3D + 3) + (D + 4) = 44 simplify
10D + 14 = 44
10D = 44 -14
D = 3
P = 3(3) + 3 = 12
H = 3 + 4 = 7
S = 22