#include <bits/stdc++.h>
using namespace std;
const long long int N = 400005;
const long long int mod1 = 998244353;
const long long int mod = 1e9 + 7;
struct dat {
  long long int c, k;
};
bool cmp(dat a, dat b) { return a.c < b.c; }
long long int a[N];
long long int n, p, r, m;
long long int chk(long long int x) {
  long long int sub = 0, ad = 0;
  for (int i = 0; i < n; ++i)
    if (a[i] < x)
      ad += x - a[i];
    else
      sub += a[i] - x;
  long long int y = 0;
  if (ad > sub)
    y = (ad - sub) * p;
  else
    y = r * (sub - ad);
  y += min(sub, ad) * min(m, p + r);
  return y;
}
void solve() {
  cin >> n >> p >> r >> m;
  long long int l = 1e18, r = 0;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
    l = min(l, a[i]);
    r = max(r, a[i]);
  }
  long long int ans;
  while (l <= r) {
    long long int lmid = (r - l) / 3 + l;
    long long int rmid = r - (r - l) / 3;
    if (chk(lmid) <= chk(rmid))
      ans = lmid, r = rmid - 1;
    else
      ans = rmid, l = lmid + 1;
  }
  cout << chk(ans);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int t = 1;
  while (t--) {
    solve();
    cout << "\n";
  }
  return 0;
}
