n = gets.chomp.to_i
a = gets.chomp.split(" ")
a.map! { |item| item.to_i }

### n = 3
### a = [500, 300, 200]

### p a.sort
value = 0
for i in 1..(n-1)
  t = (a[0] + a[1]) / 2.0
  if i == n-1
    value += t
  end
  a.delete_at(1)
  a.delete_at(2)
  a.insert(t)
end
p value