n = int(input())
v = list(map(int, input().split()))
v.sort(reverse = True)

while 1:
  temp = n % 2
  n = n//2 + temp
  v = [i/2 for i in v]
  if temp == 1:
    v[0] *= 2
  if n == 1:
    print(sum(v))
    break
