#include <bits/stdc++.h>
using namespace std;
int N, X, Y, Z;
long long Ans;
const int MAXN = 1e5 + 10;
long long a[MAXN], lsum[MAXN], rsum[MAXN];
long long f(long long x) {
  int id = lower_bound(a + 1, a + 1 + N, x) - a;
  long long cnt1, cnt2;
  cnt1 = x * (id - 1) - lsum[id - 1];
  cnt2 = rsum[id] - x * (N - id + 1);
  if (X + Y <= Z)
    return cnt1 * X + cnt2 * Y;
  else {
    long long cnt3 = min(cnt1, cnt2);
    return (cnt1 - cnt3) * X + (cnt2 - cnt3) * Y + cnt3 * Z;
  }
}
int main() {
  scanf("%d%d%d%d", &N, &X, &Y, &Z);
  for (int i = 1; i <= N; i++) scanf("%lld", &a[i]);
  sort(a + 1, a + 1 + N);
  for (int i = 1; i <= N; i++) lsum[i] = lsum[i - 1] + a[i];
  for (int i = N; i >= 1; i--) rsum[i] = rsum[i + 1] + a[i];
  int L = -1, R = 1e9 + 1, mid;
  long long f1, f2, f3;
  while (L + 1 < R) {
    int mid = (L + R) >> 1;
    f1 = f(mid - 1);
    f2 = f(mid);
    if (f1 > f2)
      L = mid;
    else
      R = mid;
  }
  printf("%lld", f(L));
  return 0;
}
