import itertools
n = int(input())
v = list(map(int,input().split()))
values = []
for root in itertools.permutations(v):
  pot = root[0]
  for i in range(n - 1):
    pot = (pot + root[i + 1]) // 2
    if i == n - 2:
      values.append(pot)
print(max(values))