#include <bits/stdc++.h>
using namespace std;
long long n, aa, r, m;
vector<long long> v;
vector<long long> a;
long long f(long long val) {
  long long target = val;
  long long beshi = 0;
  long long kom = 0;
  for (long long i = 0; i < v.size(); i++) {
    if (v[i] > target) beshi += v[i] - target;
    if (v[i] < target) kom += target - v[i];
  }
  long long cost = beshi * r + kom * aa;
  long long rp = min(kom, beshi);
  long long cost2 = (beshi - rp) * r + (kom - rp) * aa + rp * m;
  return min(cost, cost2);
}
int main() {
  cin >> n >> aa >> r >> m;
  long long x;
  for (long long i = 0; i < n; i++) {
    cin >> x;
    v.push_back(x);
  }
  sort(v.begin(), v.end());
  for (long long i = 0; i < v.size(); i++) {
    if (i == 0) {
      a.push_back(v[i]);
      continue;
    }
    if (v[i] != v[i - 1]) a.push_back(v[i]);
  }
  if (a.size() == 1) {
    cout << 0;
    return 0;
  }
  long long lo = 0;
  long long hi = 1e9;
  long long ans;
  while (lo < hi) {
    long long mid = (lo + hi) >> 1;
    long long c1 = f(mid);
    long long c2 = f(mid + 1);
    if (c1 < c2) {
      hi = mid;
      ans = min(c1, c2);
    } else {
      lo = mid + 1;
    }
  }
  cout << ans;
}
