You have n friends having some marbles initialy let ith friend has Mi marbles.you have infinite number of marbles. and you can perform folowing operation to equalize the marbles among your friends

1.you chose a friend , and give the others one marble except to chosen on.

2.you chose a friend , and give the others two marble except to chosen on.

3.you chose a friend , and give the others five marble except to chosen on.

tell minimum number of time you have to perform the above operations to equalize the marbles??plz help i realy can not get the right touch to such type questions.

example- let n=3 and initial marbles are

3 2 5

chosing 5

operate operation 2 (incresing others by two except chosen one 5)

5 4 5

chosing 5

operate opration 1 (incresing others by one except chosen one 6)

6 5 5

now chosing 6

operate opration 1 (incresing others by one except chosen one 6)

6 6 6

so minmum number of operations are three.