Let there be x people in the village so, then 4x sheep must be there.
No, number of person leaving the village, = (x - 8) [as 8 person died in Tsunami]
And the number of sheep to be carried with the survived people, 4x - (47 + 21) = x - 8. [Here we are equating No of alive sheep and no. of alive person. As 1 person has 4 sheep means 1 person = 4 sheep.]
Or, 3x = 60
Or, x = 20
Or, 4x = 80
Hence, 80 sheep