program alchemist
  implicit none
  integer :: n, v(50) = 0, i
  real(8) :: ave = 0.d0
  character(64) :: s
  read(*,*) n
  read(*,*) v(1:n)
  call quick_sort(v(1:n))
  ave = real(v(1),8)
  do i = 2, n
    ave = 0.5d0*(ave+real(v(i),8))
  end do
  write(s,'(f32.16)') ave
  write(*,'(a)') trim(adjustl(s))
contains
  recursive subroutine quick_sort(a)
    integer, intent(inout) :: a(:)
    integer :: p, c
    integer :: n, l, r, m
    n = size(a)
    l = 1
    r = n
    m = (l+r)/2
    p = a(l)+a(m)+a(r)-max(a(l),a(m),a(r))-min(a(l),a(m),a(r))
    do
      do while (a(l) < p)
        l = l+1
      end do
      do while (a(r) > p)
        r = r-1
      end do
      if (l >= r) exit
      c = a(l)
      a(l) = a(r)
      a(r) = c
      l = l+1
      r = r-1
    end do
    if (l > 2) call quick_sort(a(1:l-1))
    if (n > r+1) call quick_sort(a(r+1:n))
  end
end program alchemist