#include <bits/stdc++.h>
using namespace std;
int a[300005], n;
long long sum;
int main() {
  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) sum += (long long)a[i] * (i + 1ll);
  printf("%I64d\n", sum - (long long)a[n]);
  return 0;
}
