#include <bits/stdc++.h>
using namespace std;
long long int MOD = 1000000007;
long long int MX = 2000000000000000000;
long long int n, a, r, m;
long long int h[100100];
long long int check(long long int mid) {
  long long int mor = 0;
  long long int les = 0;
  for (int i = 1; i <= n; i++) {
    if (h[i] > mid)
      mor += h[i] - mid;
    else
      les += mid - h[i];
  }
  long long int mi = min(mor, les);
  long long int res = min((a + r) * mi, m * mi);
  mor -= mi;
  les -= mi;
  res += mor * r + les * a;
  return res;
}
int main() {
  ios::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  cin >> n >> a >> r >> m;
  for (int i = 1; i <= n; i++) cin >> h[i];
  long long int lo = 0;
  long long int hi = 2e9;
  while (hi - lo > 4) {
    long long int mid1 = (lo + hi) / 2;
    long long int mid2 = mid1 + 1;
    if (check(mid1) > check(mid2)) {
      lo = mid1;
    } else
      hi = mid2;
  }
  long long int res = MX;
  for (long long int i = lo; i <= hi; i++) res = min(res, check(i));
  cout << res << endl;
  return 0;
}
