#include <stdio.h>
#include <stdlib.h>
#include <math.h>

void dsort(double *a,int n);

int main(){
  int n;
  double val;
  double *v;
  scanf("%d",&n);
  v=(double*)malloc(n*sizeof(double));
  for (int i=0;i<n;i++) scanf("%lf",&v[i]);
  dsort(v,n);
  val=0;
  for (int i=0;i<n;i++){
    if (i==n-1) val=val+v[i]*pow(2,-i);
    else val=val+v[i]*pow(2,-i-1);
  }
  printf("%f\n",val);
  free(v);
  return 0;
}


void dsort(double *a,int n){
    double *store;
    int hf=n,unit=1,a1,a2;
    store=(double *)malloc(sizeof(double)*n);
    for (int i=0;i<n;i++) store[i]=a[i];
    while (hf>1){
        if (hf==2){
            hf=(hf+1)/2;
            for (int i=0;i<hf;i++){
                a1=0;
                a2=0;
                while (a1+a2<2*unit && 2*i*unit+a1+a2<n){
                    if (a1==unit){
                        store[2*i*unit+a1+a2]=a[(2*i+1)*unit+a2];
                        a2++;
                    }
                    else if (a2==unit || (2*i+1)*unit+a2==n){
                        store[2*i*unit+a1+a2]=a[2*i*unit+a1];
                        a1++;
                    }
                    else if (a[(2*i+1)*unit+a2]<a[2*i*unit+a1]){
                        store[2*i*unit+a1+a2]=a[2*i*unit+a1];
                        a1++;
                    }
                    else {
                        store[2*i*unit+a1+a2]=a[(2*i+1)*unit+a2];
                        a2++;
                    }
                }
            }
            for (int i=0;i<n;i++) a[i]=store[i];
            break;
        }
        else if (hf%2){
            hf=(hf+1)/2;
            for (int i=0;i<hf-1;i++){
                a1=0;
                a2=0;
                while (a1+a2<2*unit && 2*i*unit+a1+a2<n){
                    if (a1==unit){
                        store[2*i*unit+a1+a2]=a[(2*i+1)*unit+a2];
                        a2++;
                    }
                    else if (a2==unit || (2*i+1)*unit+a2==n){
                        store[2*i*unit+a1+a2]=a[2*i*unit+a1];
                        a1++;
                    }
                    else if (a[(2*i+1)*unit+a2]<a[2*i*unit+a1]){
                        store[2*i*unit+a1+a2]=a[2*i*unit+a1];
                        a1++;
                    }
                    else {
                        store[2*i*unit+a1+a2]=a[(2*i+1)*unit+a2];
                        a2++;
                    }
                }
            }
        }
        else {
            hf=(hf+1)/2;
            for (int i=0;i<hf;i++){
                a1=0;
                a2=0;
                while (a1+a2<2*unit && 2*i*unit+a1+a2<n){
                    if (a1==unit){
                        store[2*i*unit+a1+a2]=a[(2*i+1)*unit+a2];
                        a2++;
                    }
                    else if (a2==unit || (2*i+1)*unit+a2==n){
                        store[2*i*unit+a1+a2]=a[2*i*unit+a1];
                        a1++;
                    }
                    else if (a[(2*i+1)*unit+a2]<a[2*i*unit+a1]){
                        store[2*i*unit+a1+a2]=a[2*i*unit+a1];
                        a1++;
                    }
                    else {
                        store[2*i*unit+a1+a2]=a[(2*i+1)*unit+a2];
                        a2++;
                    }
                }
            }
        }
        unit*=2;
        for (int i=0;i<n;i++) a[i]=store[i];
    }
    free(store);
    return;
}

Measured memory_bytes: 256