#include <bits/stdc++.h>
using namespace std;
int n, a, r, m;
vector<int> h;
vector<long long> pref;
long long cost(long long goal) {
  long long indexl = distance(h.begin(), lower_bound(h.begin(), h.end(), goal));
  long long cost_a = 0;
  if (indexl > 0) {
    cost_a = goal * (indexl)-pref[indexl - 1];
  }
  long long indexh = distance(h.begin(), upper_bound(h.begin(), h.end(), goal));
  long long cost_r =
      pref[n - 1] - pref[indexh - 1] - (n - 1 - indexh + 1) * goal;
  long long res = 0;
  if (cost_a > cost_r) {
    res = m * cost_r + (cost_a - cost_r) * a;
  } else {
    res = m * cost_a + (cost_r - cost_a) * r;
  };
  ;
  ;
  return res;
}
void solve() {
  cin >> n >> a >> r >> m;
  m = min(m, a + r);
  h = vector<int>(n);
  pref = vector<long long>(n);
  for (int i = 0; i < n; ++i) {
    cin >> h[i];
  }
  sort(h.begin(), h.end());
  ;
  for (int i = 0; i < n; ++i) {
    if (i > 0) {
      pref[i] = pref[i - 1] + h[i];
    } else {
      pref[i] = h[i];
    }
  }
  long long answer = LLONG_MAX;
  for (int i = 0; i < n; ++i) {
    if (i > 0 && h[i] == h[i - 1]) {
      continue;
    }
    answer = min(answer, cost((long long)h[i]));
  }
  answer = min(answer, cost((long long)(pref[n - 1] / n)));
  answer = min(answer, cost((long long)(1 + pref[n - 1] / n)));
  cout << answer << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t = 1;
  for (int i = 1; i <= t; ++i) {
    solve();
  }
  return 0;
}
