if __name__ == '__main__':
    N = int(input())
    v = sorted(list(map(int, input().split())), reverse=True)
    while (len(v) > 1):
        pops = v[-2:]
        del v[-2:]
        ave = sum(pops) // 2
        v.append(ave)
    print(v.pop())