
N = int(input())
list_origin = [x for x in map(int,input().split())]

value_max = 0
for i in range(1,N):
    list = []
    list = sorted(list_origin,reverse=True)
    list_origin.append((list[0] + list[1]) / 2)
    value_max += (list[0] + list[1]) / 2
    del list_origin[0]
    del list_origin[1]
    
print(value_max)