Add all values and divide by their count. If a mean and count are given, multiply them to recover the total.
With an odd number of values, select the middle value of the sorted list. With an even count, average the middle two values.
Changing one value changes the total and often the mean. The median depends on middle positions, so changing only the size of an extreme can leave it fixed.