#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const int maxn = 1e5 + 5;
long long arr[maxn];
long long n, a, r, m;
long long f(long long h) {
  long long add = 0, minus = 0;
  for (int i = 1; i <= n; i++) {
    if (arr[i] < h) {
      add += (h - arr[i]);
    } else {
      minus += (arr[i] - h);
    }
  }
  long long num = min(add, minus) * m;
  if (add > minus) {
    num += (add - minus) * a;
  } else {
    num += (minus - add) * r;
  }
  return num;
}
void solve() {
  if (m > a + r) m = a + r;
  long long l = 0, r = inf;
  while (l < r) {
    long long midl = l + ((r - l) / 3);
    long long midr = r - ((r - l) / 3);
    if (f(midl) < f(midr)) {
      r = midr - 1;
    } else {
      l = midl + 1;
    }
  }
  cout << f(l) << endl;
  ;
}
int main() {
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);
  std::cout.tie(0);
  cin >> n >> a >> r >> m;
  for (int i = 1; i <= n; i++) {
    cin >> arr[i];
  }
  solve();
  return 0;
}
