program main
  implicit none
  integer i,N
  real(8) ans1,ans2
  real(8),allocatable :: v(:)
  read(*, *) N
  allocate(v(N))
  read(*, *) (v(i), i = 1,N)

  call qsort(v)

  do i = 1,N-1
    v(i+1) = (v(i+1)+v(i))/2
  end do

  write(*, *) v(N)

  contains

  recursive subroutine qsort(a)
  implicit none
  !integer(8),intent(in) :: n
  real(8),intent(inout) :: a(:)
  integer::i,j,n
  real(8)::toobig,toosmall,pv
  n = size(a)
  i = 1
  j = n
  pv = a((i+j)/2)
  do
     do
       if (a(i) < pv) then
         i = i+1
       else
         exit
       end if
     end do
     do
       if(a(j) > pv) then
         j = j-1
       else
         exit
       end if
     end do
     if (i>=j) then
       exit
     else
       toobig = a(j)
       toosmall = a(i)
       a(i) = toobig
       a(j) = toosmall
       i = i+1
       j = j-1
     end if
   end do
   if (i > 2) then
     call qsort(a(1:i-1))
   end if
   if (j < n-1) then
     call qsort(a(j+1:n))
   end if
  end subroutine qsort
end program main
