#include <bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
using namespace __gnu_pbds; 
#define p(x,y) pair<x,y>
#define oset(x) tree<x, null_type, less<x>, rb_tree_tag, tree_order_statistics_node_update>
#define all(x) (x).begin(),(x).end()
#define ll long long
#define scan(a) for(auto &it:a)cin>>it;
#define print(a) {for(auto it:a)cout<<it<<" ";cout<<endl;}
#define out(x) cout<<((x)?"YES":"NO")<<endl;
#define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))
#define int ll
#define prime 1000000007
void solve()
{
    int n;
    cin>>n;
    long double a[n],sum=0.0,ans,suf[n],x;
    rep(i,0,n)
    {
        int t;
        cin>>t;
        a[i]=t;
        sum+=a[i];
    }
    sort(a,a+n);
    suf[n-1]=a[n-1];
    rep(i,n-1,0)
    {
        suf[i]=suf[i+1]+a[i];
    }
    // print(a);
    // print(suf);

    ans=min(sum,n*(a[n-1]/2.0));
    // cout<<ans<<"\n";
    rep(i,0,n)
    {
        x=a[i]/2.0;
        int no=upper_bound(a,a+n,2*x)-a;
        long double t=x*(no);
        if(no<n)
            t+=suf[no]-(n-no)*x;
        ans=min(ans,t);
        // cout<<x<<":-"<<t<<" "<<no<<" "<<n-no<<"\n";
    }
    // rep(i,0,n)
    // {
    //     x=a[i];
    //     int no=lower_bound(a,a+n,x)-a;
    //     long double t=(x/2*(no+1);
    //     if(no<n)
    //         t+=suf[no];
    //     ans=min(ans,t);
    //     // cout<<t<<" ";
    // }
    cout<<ans/(1.00*n);
}
int32_t main()
{
    ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
    int t=1;
    cout.setf(ios::fixed, ios::floatfield);cout.precision(10); 
    // init();
    //cin>>t;
    while(t--)
    {
        solve();
    }
    return 0;
}

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<pii> vii;
typedef vector<vi> vvi;
typedef vector<pll> vll;
typedef vector<vl> vvl;

#define fori(i, n) for (int i = 0; i < n; i++)
#define ford(i, n) for (int i = n - 1; i >= 0; i--)
#define rep(i, a, b) for (int i = a; i <= b; i++)
#define repd(i, a, b) for (int i = a; i >= b; i--)
#define trav(x, a) for (auto &x : a)
#define all(x) (x).begin(), (x).end()
#define pb push_back
#define eb emplace_back
#define endl '\n'
#define sz(a) (int)(a).size()
#define fi first
#define se second

clock_t time_p = clock();
void time_taken()
{
    time_p = clock() - time_p;
    cerr << "Time Taken : " << (float)(time_p) / CLOCKS_PER_SEC << "\n";
}

const ll mod = 1e9 + 7;
const ll INF = 1e18;

int main()
{
    ios_base::sync_with_stdio(false), cin.tie(nullptr);

    int n;
    cin >> n;
    map<ld, int> a;
    ld c = 0;
    fori(i, n)
    {
        ld x;
        cin >> x;
        c += x;
        a[x]++;
    }

    ld m = -n;
    ld at = 0;
    for (auto x : a)
    {
        at = x.fi / 2;
        m += 2 * x.se;
        c -= x.fi * x.se;
        if (m >= 0)
        {
            break;
        }
    }

    cout.precision(12);
    cout << fixed;
    cout << (m * at + c) / n << endl;

    time_taken();
    return 0;
}