import math
import sys
import numpy as np
from collections import defaultdict, deque, Counter 
from itertools import accumulate, product, permutations,combinations, combinations_with_replacement
from operator import itemgetter
from bisect import bisect_left,bisect
from heapq import heappop,heappush
from fractions import gcd

max_value = 1000000000
min_value = -1000000000
sys.setrecursionlimit(max_value)


n = int(input())
v_list = list(map(float,input().split()))
v_list.sort()

v_list = np.array(v_list)


for i in range(n):
	v_list[i] = v_list[i] / (2**(n-i))
v_list[0] = v_list[0] * 2

print(int(np.sum(v_list)))