#include <iostream>
#include <algorithm>
#include <iomanip>
using namespace std;
int main()
{
int n, a[200];
while (cin >> n)
{
double ave, s = 0;
int i;
for (i = 0; i<n; i++)
cin >> a[i];
sort(a, a + n);
for (int j = 1; j < n - 1; j++)
s = s + a[j];
ave = s / (n - 2);
cout << setprecision(2) << fixed << ave << endl;
}
}