#include <bits/stdc++.h>

using namespace std;

#define mod 1000000007
#define mod2 998244353
#define ll long long 
#define gi(n) long long n;cin>>n
#define ga(a,n) long long a[n];for(ll i=0;i<n;i++)cin>>a[i]
#define YES cout<<"YES"<<endl
#define NO cout<<"NO"<<endl
#define TEST(t) ll t; cin>>t; while(t--)
#define fastio ios_base::sync_with_stdio(false); cin.tie(NULL);cout.tie(NULL)
#define flo(i,a,b) for(ll i=a;i<b;i++)
#define floe(i,a,b) for(ll i=a;i<=b;i++)
#define newline cout<<"\n"
#define gis(s) string s;cin>>s
#define p(a) cout<<a
#define pn(a) cout<<a<<endl
char a[1000][1000];

typedef vector<ll> vl;
typedef pair<ll,ll> pll;
typedef map<ll,ll> mll;

ll gcd(ll x, ll y)
{
    if(x==0) return y;
    return gcd( y%x ,x);
}

ll powM(ll x, ll y, ll m)
{
    ll ans=1, r=1;
    x=x%m;
    while(r>0 && r<=y)
    {
        if(r & y)
        {
            ans=ans*x;
            ans=ans%m;
        }
        r=r<<1;
        x=x*x;
        x=x%m;
    }
    return ans;
}

ll countbits(ll n)
{
    ll cot=0;
    while(n)
    {
        cot++;
        n >>= 1;
    }
    return cot;
}

ll comb2(ll n)
{
    return n*(n-1)/2;
}
ll sum_of_digits(ll n){
    ll b=0;
    while(n!=0){
        b=b+(n%10);
        n=n/10;
    }
    return b;
}
ll no_of_digits(ll n){
    ll b=0;
    while(n!=0){
        b=b+1;
        n=n/10;
    }
    return b;
}
bool check(int array[], int n)
{   
    bool flag = 0;

    for(int i = 0; i < n - 1; i++)      
    {         
        if(array[i] != array[i + 1])
            flag = 1;
    }

    return flag;
}
long long int factorial(long long int n){
    ll ans=1;
    flo(i,1,n+1){
        ans*=i;
    }
    return ans;
}
bool spure(int i,int j,int h,int m){
 if(a[i][j]=='.'){
    return false;
 }
else{
    if(h==1){
        if(a[i][j]=='*'){
            return true;
        }
        return false;
    }
    else{
        if(j-1>=0 && j+1<m){
        bool pk=spure(i+1,j+1,h-1,m) && spure(i+1,j,h-1,m) && spure(i+1,j-1,h-1,m);
        return pk;
    }
    else{
        return false;
    }
    }
}

}
int main(){
    fastio;
    gi(a);
    gi(b);
    gi(c);
    gi(d);
    cout<<min(a,min(b,min(c,d)));
return 0;   

}
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;

template<class T>
bool chmin(T &a, const T &b) { if (a > b) { a = b; return true; } return false; }
template<class T>
bool chmax(T &a, const T &b) { if (a < b) { a = b; return true; } return false; }

using ll = long long;
using P = pair<int, int>;
using vvi = vector<vector<int>>;
using vi = vector<int>;

const ll MOD = 1e9 + 7;
const int INF = 1001001001;
const double PI = 3.14159265358979323846;

const int lim = 1e5+5;
int n;
double A[lim];

double func(double x) {
    double res = 0;
    rep(i, n) {
        res += x + A[i] - min(A[i], x*2);
    }
    return res;
}

void solve() {
    cin >> n;
    rep(i, n) cin >> A[i];

    double low = 0;    
    double high = 1e10;

    int cnt = 500;
    while (cnt--) {
        double c1 = (low*2 + high) / 3;
        double c2 = (low + high*2) / 3;
        if (func(c1) > func(c2)) low = c1;
        else high = c2;
    }

    double ans = func(low) / n;
    cout << setprecision(20) << fixed << ans << endl;
}

int main() {

    solve();

    return 0;
}
