#include <bits/stdc++.h>
#include <iostream>
using namespace std;
#define ll long long
#define ld long double
#define mp make_pair
#define pb push_back
#define fo(i,n) for(ll i=0;i<n;i++)
#define fo1(i,n) for(ll i=1;i<=n;i++)
#define loop(i,a,b)for(ll i=a;i<=b;i++)
#define loopr(i,a,b)for(ll i=b;i>=a;i--)
#define vll vector<ll> 
#define vvl vector<vll>
#define vvvl vector<vvl>
#define pii pair<ll,ll>
#define piii pair<ll,pair<ll,ll>>
#define F first
#define S second
#define M 1000000007
ll max(ll a,ll b){if (a>b) return a; else return b;}
ll min(ll a,ll b){if(a<b) return a; return b;}
ll mod=998244353;
vll pr;

void seive(ll n)
{
    bool prime[n + 1];
    memset(prime, true, sizeof(prime));
    for (int p = 2; p * p <= n; p++)
    {
        if (prime[p] == true)
        {
            for (int i = p * p; i <= n; i += p)
                prime[i] = false;
        }
    }
 
    // Print all prime numbers
    for (int p = 2; p <= n; p++)
        if (prime[p])
        	pr.pb(p);
}
    
ll powermod(ll x,ll y,ll p)  {
  ll res = 1;     
    x = x % p; 
 if (x == 0) return 0;  
    while (y > 0)  
    {     if (y & 1)  
            res = (res*x) % p;  
        y = y>>1; // y = y/2  
        x = (x*x) % p;  
    }  
    return res;  
}
 
ll gcd(ll x, ll y){
    if (y == 0)
    return x;
    else
    return gcd(y, x % y);
}
 
ll nck(ll n, ll k){
    ll C[k + 1];
    memset(C, 0, sizeof(C));
    C[0] = 1;
    for (ll i = 1; i <= n; i++) {
        for (ll j = min(i, k); j > 0; j--)
            C[j] = (C[j]%M + C[j - 1]%M)%M;
    }
    return C[k]%M;
}
 
void call(vll &primefactor,int N){
    for(int i=1;i<N;i++)
    {
        primefactor[i]=i;
    }
    for(int i=2;i<N;i++)
    {
        if(primefactor[i]!=i)  
            continue;
        for(int j=i;j<N;j+=i)
            primefactor[j]=i;  
    }
}

int main(){
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	ll t=1;
    //cin>>t;
    while(t--){
        ll n; cin>>n;
        vll v(n);
        ll s=0;
        fo(i,n){
            cin>>v[i];
            s+=v[i];
        }
        sort(v.begin(),v.end());
        vll run(n);
        ll ss=0;
        fo(i,n){
            ss+=v[i];
            run[i]=ss;
        }
        ld ans=1e18;
        fo(i,n){
            ld x=(ld)v[i]/2.0;
            while(i<n && v[i]==x*2)
            i++;
            i--;
           // cout<<i<<"   "<<v[i]<<endl;
            ld num=n*x+s-(n-i-1)*v[i]-run[i];
            ld an=num/n;
            if(an<ans)
            ans=an;
        }
        cout<<setprecision(8)<<ans<<endl;
    }
    return 0;
}
#include<bits/stdc++.h>
#define reg register
typedef long long ll;
using namespace std;
inline int qr(){
	int x=0,f=0;char ch=0;
	while(!isdigit(ch)){f|=ch=='-';ch=getchar();}
	while(isdigit(ch)){x=(x<<1)+(x<<3)+(ch^48);ch=getchar();}
	return f?-x:x;
}
const int N=1e5+100;
int n;
double a[N];
int main(){
	n=qr();
	for(reg int i=1;i<=n;i++){
		scanf("%lf",&a[i]);
	}
	sort(a+1,a+n+1);
	int mid=(1+n)/2;
	double x=a[mid]/2;
	double ans=0;
	for(reg int i=1;i<=n;i++){
		ans+=x+a[i]-min(x*2,a[i]);
	}
	printf("%.7f",ans/n);
	return 0;
}