#include <bits/stdc++.h>
using namespace std;
long long a[1000005];
long long aa, b, c, n;
long long cal(long long x) {
  long long p1 = 0, p2 = 0;
  for (int i = 1; i <= n; i++) {
    if (a[i] >= x) {
      p2 += a[i] - x;
    } else
      p1 += x - a[i];
  }
  long long rtt;
  if (c >= aa + b)
    rtt = p1 * aa + p2 * b;
  else {
    long long p3 = min(p1, p2);
    p1 -= p3;
    p2 -= p3;
    rtt = p3 * c + p1 * aa + p2 * b;
  }
  return rtt;
}
long long solve(long long l, long long r) {
  while (r > l) {
    long long m1 = (2 * l + r) / 3;
    long long m2 = (2 * r + l + 2) / 3;
    if (cal(m1) < cal(m2))
      r = m2 - 1;
    else
      l = m1 + 1;
  }
  return l;
}
int main() {
  long long i, j;
  long long l = 0, r = 1e9 + 3;
  cin >> n >> aa >> b >> c;
  for (i = 1; i <= n; i++) scanf("%lld", &a[i]);
  long long pos = solve(l, r);
  l = pos - 200;
  r = pos + 200;
  l = max(l, 0ll);
  long long daan = 8000000000000000000ll;
  for (i = l; i <= r; i++) {
    daan = min(daan, cal(i));
  }
  cout << daan << endl;
  return 0;
}
