#include <bits/stdc++.h>

using namespace std;

#define flush cout.flush

using ll = long long;
using ull = unsigned long long;
using ld = long double;
using pl = pair<ll, ll>;
const ll INF = 1e9 + 7;
const ll mod = 1e9 + 7;
const ll mod2 = 998244353;
const ld eps = 1e-9;
const ld PI = acos(-1);

ld C = (ld) 9 / (ld) 20;
vector<ld> a;

ld f(ld x) {
    ld s = 0.0;
    for (auto &t : a) {
        s += x + t - min(t, 2.0 * x);
    }
    s /= a.size();
    return s;
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(NULL);
    ll n;
    cin >> n;
    a.resize(n);
    for (ld &i :a)cin >> i;
    ld l = 0.0, r = 1e14 + 200;
    while (r - l > eps) {
        ld m1 = l + C * (r - l);
        ld m2 = r - C * (r - l);
        if (f(m2) > f(m1)) {
            r = m2;
        } else l = m1;
    }
    cout << fixed << setprecision(20);
    cout << f(l) << "\n";
    return 0;
}
#include<bits/stdc++.h>
using namespace std;
#define DONTSYNC ios_base::sync_with_stdio(false);   cin.tie(NULL); cout.tie(NULL) //dont use stdio with iostream functions //input and output are out of order now!
#define TEST unsigned long long T; cin>>T; while(T--)  //loop over each testcase
#define endl "\n"
#define fori(a,start,end) for(int a=start;a<end;a++)
#define forl(a,start,end) for(long long a=start;a<end;a++)
#define fi first
#define se second
#define all(x) (x).begin(), (x).end()
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<pll>   vll;
typedef vector<vi>    vvi;
typedef vector<vl>    vvl;
const double PI = acos(-1);
ld calculate_prof(ld x,vector<ld> &arr,vector<ld> &pref){
    int n=arr.size()-1; ld prof=0;
    int r=lower_bound(all(arr),2*x)-arr.begin();
    prof=(n+1-r)*2*x + pref[r-1] - x*n;
    return prof;
}
void solve(){
    /* code */
    int n; cin>>n;
    vector<ld> arr(n+1),pref(n+1); pref[0]=0; arr[0]=0;
    ld tot=0;
    fori(i,1,n+1){
        cin>>arr[i];
        tot+=arr[i];
    }sort(all(arr));
    fori(i,1,n+1) pref[i]=arr[i]+pref[i-1];
    ld prof=0,x=0;
    fori(i,1,n+1){
        ld cur_prof;
        cur_prof=calculate_prof(arr[i]/2,arr,pref);
        if(cur_prof>prof) prof=cur_prof,x=arr[i]/2;
        // cur_prof=calculate_prof(arr[i],arr,pref);
        // if(cur_prof>prof) prof=cur_prof,x=arr[i];
    }
    cout<<fixed<<setprecision(6)<<(tot-prof)/n<<endl;
}

int main()
{
    DONTSYNC;
    // TEST
    solve();
    return 0;
}
