#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
using namespace std;
const int M=100000;
long long a[M+10];
long long ans;
int main()
{
freopen("game_.in","r",stdin);
freopen("game_.out","w",stdout);
int n;
scanf("%d",&n);
for(int i=1;i<=n;i++)
scanf("%d",&a[i]);
sort(a+1,a+n+1);
for(int i=1;i<=n;i++)
{
ans+=a[i]*i;
if(i!=n)
ans+=a[i];
}
printf("%lld\n",ans);
return 0;
}