//#include <atcoder/all>
#include <bits/stdc++.h>
//#include <windows.h>

//#include <time.h>
using namespace std;
//using namespace atcoder;
using ll = long long;
#define all(A) A.begin(),A.end()
using vll = vector<ll>;
#define rep(i, n) for (long long i = 0; i < (long long)(n); i++)
using Graph = vector<vector<tuple<ll, ll, ll>>>;


int main() {
    ll N;
    cin>>N;
    vll A(N);
    rep(i,N)cin>>A[i];
    sort(all(A));
    ll M=N/2;
    double K=double(A[M])/2.0;
    double s=0;
    rep(i,N){
       s+=K+A[i]-min(2*K,double(A[i]));
    }
    s/=N;
    cout<<setprecision(16)<<s<<endl;
}



#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
typedef long long int lli;
typedef unsigned long long int ulli;
typedef long double ld;
typedef vector<lli> vi;
typedef vector<vi> vvi;
typedef pair<lli, lli> pii;
#define vec(s) vector<s>
#define vvec(s) vector<vector<s>>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define Yes(x) cout << (x ? "Yes" : "No") << endl;
#define YES(x) cout << (x ? "YES" : "NO") << endl;
#define out(s) cout << s << endl;
#define Reverse(x) reverse(all(x));
#define Sort(x) sort(all(x));
#define pb(s) push_back(s);
#define sp " "
#define INF 10000000000
#define LINF 9000000000000000000
#define all(s) s.begin(), s.end()
void vout(vi v)
{
    for (lli i = 0; i < v.size(); i++)
        cout << v.at(i) << endl;
}
int main()
{
    lli n;
    cin >> n;
    vi a(n);
    rep(i, n)
    {
        cin >> a[i];
    }
    lli ans = 2e9;
    rep(i, 1 << (n - 1))
    {
        lli xored = 0;
        lli ored = 0;
        rep(j, n + 1)
        {
            if (j < n)
            {
                ored |= a[j];
            }
            if (j == n || (i >> j & 1))
            {
                xored ^= ored;
                ored = 0;
            }
        }
        ans = min(ans, xored);
    }
    out(ans);
}