#include <bits/stdc++.h>
using namespace std;
long long s[100005];
long long n, a, b, c;
inline long long r() {
  char h = getchar();
  long long y = 0, q = 1;
  while (h < '0' || h > '9') {
    if (h == '-') q = -1;
    h = getchar();
  }
  while (h >= '0' && h <= '9') {
    y = y * 10 + h - '0';
    h = getchar();
  }
  return y * q;
}
inline long long pd(long long x) {
  long long d = 0, g = 0;
  for (long long i = 1; i <= n; i++) {
    if (s[i] < x)
      d += x - s[i];
    else
      g += s[i] - x;
  }
  long long q = min(d, g);
  long long da = c * q;
  d -= q;
  g -= q;
  return da + a * d + b * g;
}
signed main() {
  n = r(), a = r(), b = r(), c = r();
  c = min(c, a + b);
  long long l = 1000000000000000005, ri = 0, dl, dri;
  for (long long i = 1; i <= n; i++)
    s[i] = r(), l = min(l, s[i]), ri = max(ri, s[i]);
  dl = pd(l);
  dri = pd(ri);
  while (l + 3 < ri) {
    long long m2 = ri - (ri - l + 1) / 3, m1 = l + ri - m2;
    long long d1 = pd(m1), d2 = pd(m2);
    if (d1 < d2)
      ri = m2, dri = d2;
    else if (d2 < d1)
      l = m1, dl = d1;
    else {
      if (dri > d2) ri = m2, dri = d2;
      if (dl > d1) l = m1, dl = d1;
    }
  }
  long long da = 1000000000000000005;
  for (long long i = l; i <= ri; i++) da = min(da, pd(i));
  printf("%lld\n", da);
  return 0;
}
