#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
const long long inf = 0x3f3f3f3f3f3f3f3f;
long long powmod(long long a, long long b) {
  long long res = 1;
  a %= mod;
  for (; b > 0; b >>= 1) {
    if (b & 1) res = res * a % mod;
    a = a * a % mod;
  }
  return res;
}
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
inline int read() {
  int s = 0, w = 1;
  char ch = getchar();
  while (ch < 48 || ch > 57) {
    if (ch == '-') w = -1;
    ch = getchar();
  }
  while (ch >= 48 && ch <= 57)
    s = (s << 1) + (s << 3) + (ch ^ 48), ch = getchar();
  return s * w;
}
const int N = 1e6 + 7;
long long n, m, fl = 0, ans = inf;
long long s[N];
long long a, b, c;
long long f(long long x) {
  long long cnt = 0, jia = 0, jian = 0;
  for (int i = 1; i < n + 1; i++) {
    if (s[i] > x)
      jian += s[i] - x;
    else
      jia += x - s[i];
  }
  if (a + b > c) {
    long long mn = min(jia, jian);
    cnt += c * mn;
    jia -= mn;
    jian -= mn;
  }
  return cnt + jia * a + jian * b;
}
int main() {
  scanf("%lld%lld%lld%lld", &n, &a, &b, &c);
  for (int i = 1; i < n + 1; i++) {
    scanf("%lld", &s[i]);
  }
  long long l = 0, r = 1e9, m1, m2;
  while (l + 3 <= r) {
    m1 = l + (r - l) / 3, m2 = r - (r - l) / 3;
    if (f(m1) < f(m2)) {
      r = m2 - 1;
    } else {
      l = m1 + 1;
    }
  }
  for (int i = l; i < r + 1; i++) {
    ans = min(ans, f(i));
  }
  printf("%lld\n", ans);
  return 0;
}
