#include using namespace std; int main() { long long a[50],n,ans=0,i; cin>>n; for(i=0;i>a[i]; sort(a,a+n); for(i=n-1;i>=0;i--) ans+=pow(2,n-1-i)*a[i]; cout<