Remember that to take an average, you need to add all the indices of refraction together first, and then you divide by the number of indices you had.