#include using namespace std; #define ll long long #define MOD 1000000007 #define INF 1e18 #define pb push_back #define pi pair ll c[50]; int main() { ll n; cin>>n; for(int i=0;i>c[i]; } sort(c,c+n); ll cnt=0; ll ans=0; for(int i=n-1;i>=0;i--) { ans=ans+c[i]*pow(2,cnt); cnt++; } cout<