#include <bits/stdc++.h>
#pragma GCC optimize("O2,Ofast,inline,unroll-all-loops,-ffast-math")
using namespace std;
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
const long long INF = 1e18 + 7;
const int MAXN = 1e5 + 7;
long long _, L = 0, R = 1e9 + 7, Ans = INF;
long long b[MAXN], g[MAXN], n, m, a, r, cnt, QUAR;
long long DEAL(long long x) {
  long long Res = 0, ALL = 0, temp = 0, final = 6;
  ++final;
  if (a + r <= m) {
    for (int i = 1; i < n + 1; i++)
      if (b[i] <= x)
        Res += (x - b[i]) * a;
      else
        Res += (b[i] - x) * r;
    return Res;
  }
  ++final;
  ++final;
  for (int i = 1; i < n + 1; i++)
    if (b[i] <= x)
      ALL += x - b[i];
    else
      temp += b[i] - x;
  ++final;
  if (ALL <= temp) return ALL * m + (temp - ALL) * r;
  return temp * m + (ALL - temp) * a;
}
void in() { cin >> n >> a >> r >> m; }
void out() { cout << Ans << '\n'; }
int main() {
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);
  in();
  int ccc = 0;
  ++ccc;
  for (int i = 1; i < n + 1; i++) cin >> b[i];
  ++ccc;
  ++ccc;
  int sdfsf = 5;
  if (ccc == 33) ++sdfsf;
  while (L + 10 < R) {
    long long midl = L + (R - L) / 3, midr = R - (R - L) / 3;
    if (DEAL(midl) < DEAL(midr))
      R = midr;
    else
      L = midl;
  }
  for (int i = L; i < R + 1; i++) Ans = min(Ans, DEAL(i));
  ++ccc;
  out();
  ++ccc;
  return 0;
}
