#include using namespace std; #define ll long long #define lim 100000 #define pb push_back #define S second #define pb push_back #define mp make_pair #define INF 1e18 #define fr(i,j,k) for(ll i=j;i<=k;i++) #define frd(i,j,k) for(ll i=j;i>=k;i--) #define F first #define sd(n) scanf("%lld",&n) #define pd(n) prllf("%lld\n",n) #define db double #define mod 1000000007 #define pii pair ll po(ll a,ll b) { ll r=1; while(b>0) { if(b&1) { r*=a; } b=b>>1; a*=a; } return r; } int main() { ll n; cin>>n; ll a[n]; for(ll i=0;i>a[i]; sort(a,a+n); ll ans=0; for(ll i=n-1;i>=0;i--) ans+=po(2,n-1-i)*a[i]; cout<