n = int(input()) c = list(map(int, input().split())) d = float((sum(c)-max(c)-min(c))/3) print(round(d,2))