}
#include<iostream>//15ms
#include<iomanip>
using namespace std;
void qsort(int a[],int left,int right);
int main()
{
int i,a,n,mix,max;
double sum;
while(cin>>n)
{
sum=0;mix=101;max=-1;
for(i=0;i<n;i++)
{
cin>>a;
if(a>max)max=a;
if(a<mix)mix=a;
sum+=a;
}
cout<<setiosflags(ios::fixed)<<setprecision(2)<<(sum-mix-max)/(n-2)<<endl;
}
return 0;
}