/* Esteban Arango Medina */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long ll; typedef pair ii; typedef pair si; typedef pair iii; typedef vector vi; typedef vector vc; typedef vector vsi; typedef vector vii; typedef vector vivi; typedef vector vs; typedef map msvs; typedef map msi; typedef map mss; #define INF 1000000000 int main(){ // freopen("in.in", "r", stdin); // freopen("out.out", "w", stdout); int n; cin >> n; vi calories(n); for(int calories_i = 0; calories_i < n; calories_i++){ cin >> calories[calories_i]; } sort(calories.begin(),calories.end()); ll ans = 0; for(int i = n-1, j=0; i > -1; i--,j++){ ans += calories[i] * pow (2, j); } cout<