N = int(input())
nums = [int(i) for i in input().split()]
LOOP = int(np.log2(N))+1
LOOP_N = N

for _ in range(LOOP):
    is_odd = (LOOP_N%2 == 1)
    LOOP_N = math.ceil(LOOP_N/2)
    nums = [nums[2*i] if (i==LOOP_N-1 and is_odd) else (nums[2*i]+nums[2*i+1])/2  for i in range(LOOP_N)]

print(nums[0])