N = int(input().strip()) A = sorted([int(i) for i in input().strip().split(' ')]) A = A[1:-1] print(sum(A) / len(A))