n,arr = int(input()),list(map(int,input().split(' ')))
stack = []
arr = sorted(arr)
for i in range(0,len(arr),2):
    if i == len(arr)-1:
        print(int((stack[-1] + arr[i])/2))
    else:
        stack.append((arr[i] + arr[i+1])/2)