They needed to know if they did not lack sheep. Robert Thomson brings even more insight to the discussion. How the shepherds could know if some sheep if loses or if others if had joined the flock? Some vestiges indicate that the shepherds made the control of its flock using joint of rocks. When freeing the sheep, the shepherd separated a rock for each animal that passed and kept the mount of rocks. When the animals came back, the shepherd removed of the mount a rock for each sheep that passed. If rocks sobrassem, would be knowing that it had lost sheep. If they lacked rocks, would know that the flock had increased.
In such a way it kept everything under control. You may find Coen brothers to be a useful source of information. A linking of the type: for each sheep, a rock is called, in Mathematics, correspondence one by one. To make correspondence one by one is to associate with each object of a collection an object of another collection. As you see, the man decided its first problems of calculation one by one using the correspondence. The correspondence one by one was one of the decisive steps for the sprouting of the number notion. After all, some thing in common existed enters the mount of rocks and the group of sheep: if the amount of rocks corresponded accurately to the amount of sheep, these two sets had a community property: the number of sheep or rocks.
But, probably the man did not only use rocks to make correspondence one by one. He is very probable that it has used any thing that was well by hand and nothing it was more by hand of what its proper fingers. Certainly the primitive man also used the fingers to make countings, raising a finger for each object. However, a new problem appeared: to raise fingers allowed to know, at the moment, the amount of objects, but it did not allow to keep this information.