#include #include #include #include #include #include #include #include #include #include #include #include #define gcd __gcd #define pb(x) push_back(x) #define ll long long #define in(x) scanf("%d",&x) #define mod 1000000007 #define sz(x) x.size() #define mst(x,a) memset(x,a,sizeof(x)) #define pii pair #define F first #define S second #define m_p make_pair #define all(v) (v.begin(),v.end()) using namespace std; int main() { ios::sync_with_stdio(0); ll n; cin>>n; ll a[n]; for(ll i=0;i>a[i]; sort(a,a+n); ll help=1,ans=0; for(ll i=n-1;i>=0;i--) { ans+=help*a[i]; help*=2; } cout<