#include<bits/stdc++.h>
using namespace std;
int main()
{
double n;
cin>>n;
double c=11;
double e=0;
double b;
double d=0;
if(n<=0)
{
cout<<fixed<<setprecision(2)<<n<<endl;
return 0;
}
for(int a=1;a<=n;a++)
{
cin>>b;
d=d+b;
if(b<=c)
{
c=b;
}
else
{
c=c;
}
if(b>=e)
{
e=b;
}
else
{
e=e;
}
}
d=(d-e-c)/(n-2);
cout<<fixed<<setprecision(2)<<d<<endl;
return 0;
}
//欢迎找错