import heapq
size = int(input())
li = list(map(int,input().split()))
heapq.heapify(li)
while(len(li)>1):
    a = heapq.heappop(li)
    b = heapq.heappop(li)
    heapq.heappush(li,(a+b)//2)
print(li[0])
