#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
long long n, a, b, m, ans;
long long h[N];
long long chk(int lim) {
  long long ret = 0, x = 0, y = 0;
  for (int i = 1; i <= n; i++) {
    if (h[i] < lim)
      x += lim - h[i];
    else
      y += h[i] - lim;
  }
  if (m <= a + b) {
    long long z = min(x, y);
    ret += m * z;
    x -= z, y -= z;
  }
  ret += a * x + b * y;
  return ret;
}
int main() {
  cin >> n >> a >> b >> m;
  for (int i = 1; i <= n; i++) scanf("%lld", &h[i]);
  sort(h + 1, h + n + 1);
  long long l = 0, r = h[n];
  while (l < r) {
    long long lmid = l + (r - l) / 3, rmid = r - (r - l) / 3;
    long long lans = chk(lmid), rans = chk(rmid);
    if (lans <= rans) {
      ans = lans, r = rmid - 1;
    } else {
      ans = rans, l = lmid + 1;
    }
  }
  printf("%lld\n", ans);
  return 0;
}
