#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
int n, a, r, m, v[N];
long long sum1, sum2;
long long check(int x) {
  sum1 = sum2 = 0;
  for (int i = 1; i <= n; i++) {
    if (v[i] < x)
      sum1 += x - v[i];
    else
      sum2 += v[i] - x;
  }
  if (sum1 < sum2) return m * sum1 + r * (sum2 - sum1);
  return m * sum2 + a * (sum1 - sum2);
}
int main() {
  scanf("%d %d %d %d", &n, &a, &r, &m);
  for (int i = 1; i <= n; i++) scanf("%d", &v[i]);
  m = min(m, a + r);
  int l = 0, r = 2e9, mid, lmid, rmid;
  long long lsum, rsum;
  while (l + 1 < r) {
    mid = (r - l + 1) / 3;
    lmid = l + mid;
    rmid = r - mid;
    lsum = check(lmid);
    rsum = check(rmid);
    if (lsum > rsum)
      l = lmid;
    else
      r = rmid;
  }
  printf("%lld", min(check(l), check(l + 1)));
  return 0;
}
