#include <stdio.h>
#include <algorithm>
long long n;
long long a[100000];
double s, t, z;
int main() {
	scanf("%lld", &n);
	for (int i = 0; i < n; i++) {
		scanf("%lld", a + i);
	}
	std::sort(a, a + n);
	t = a[n / 2];
	for (int i = 0; i < n; i++) {
		if (t < a[i])z += t - a[i];
	}
	printf("%.10lf\n", t / 2 - z / n);
}
  #include<bits/stdc++.h>
  using namespace std;
  using ll = long long;
  using C = complex<double>;
  #define rep(i,f,n) for(ll i=(f); (i) < (n); i++)
  #define repe(i,f,n) for(ll i=(f); (i) <= (n); i++)
  #define repc(i,f,n) for(char i=(f); (i) <= (n); i++)
  //#define PI 3.14159265358979323846264338327950L
  #define debug(x) cout<<#x<<" :: "<<x<<"\n";
  #define debug2(x,y) cout<<#x<<" :: "<<x<<"\t"<<#y<<" :: "<<y<<"\n";
  #define debug3(x,y,z) cout<<#x<<" :: "<<x<<"\t"<<#y<<" :: "<<y<<"\t"<<#z<<" :: "<<z<<"\n";
  #define Pl pair<ll, ll>
  #define OUT(x) cout << x << endl; return 0;
  #define ALL(x) (x).begin(),(x).end()
  #define UNIQUE(x) (x).erase(unique(ALL(x)),(x).end()) //x must be sorted
  //printf("%.10f\n")
  //cout << fixed << setprecision(10);
  template<class T> inline bool chmax(T& a, T b){if (a < b) { a = b; return true; } return false;}
  template<class T> inline bool chmaxe(T& a, T b){if (a <= b) { a = b; return true; } return false;}
  template<class T> inline bool chmin(T& a, T b){if (a > b) { a = b; return true; } return false;}
  const ll MOD = 1000000007ll;
  const ll INF = 1e+18;
  const int iINF = 1e9;
  const double EPS = 1e-8;
  //const double PI = acos(-1.0);


int
main()
{
  ll N; cin >> N;
  vector<ll> A(N);
  double asum = 0;
  rep(i, 0, N) cin >> A[i], asum += A[i];
  sort(ALL(A));
  vector<ll> acum(N + 1, 0);
  rep(i, 0, N) acum[i + 1] = acum[i] + A[i];

  double ok = 0;
  double ng = 1000000000;
  auto check = [&](double ins){
    double cst = (double)N * ins + asum;
    auto ps = lower_bound(ALL(A), 2 * ins) - A.begin();
    double rt = acum[ps] + (2 * ins * (N - ps));
    double e = (cst - rt) / (double)N;

    return e;
  };
  while(abs(ok - ng) >= 0.000001){
    double mid1 = (ok + ok + ng) / 3;
    double mid2 = (ok + ng + ng) / 3;
    if(check(mid1) < check(mid2)){
      ng = mid2;
    } else {
      ok = mid1;
    }
  }

  cout << fixed << setprecision(10);
  cout << check(ok) << endl;
}