#include <bits/stdc++.h>
const long long MOD = 1e9 + 7;
const long long INF = 1e9 + 7;
using namespace std;
inline long long read();
int a[100010];
int n, A, R, M;
long long solve(int x) {
  long long sum1 = 0, sum2 = 0;
  for (int i = 1; i <= n; i++) {
    if (a[i] > x)
      sum1 += a[i] - x;
    else if (a[i] < x)
      sum2 += x - a[i];
  }
  long long ans = 0;
  long long mid = min(sum1, sum2);
  ans += mid * M;
  sum1 -= mid, sum2 -= mid;
  if (sum1) ans += sum1 * R;
  if (sum2) ans += sum2 * A;
  return ans;
}
int main() {
  n = read(), A = read(), R = read(), M = read();
  M = min(M, A + R);
  for (int i = 1; i <= n; i++) a[i] = read();
  int l = 0, r = 1e9;
  while (l < r) {
    int lmid = l + (r - l) / 3;
    int rmid = r - (r - l) / 3;
    if (solve(lmid) >= solve(rmid))
      l = lmid + 1;
    else
      r = rmid - 1;
  }
  cout << min(solve(l), solve(r));
  return 0;
}
inline long long read() {
  long long p = 1, ans = 0;
  char ch = getchar();
  while (ch < 48 || ch > 57) {
    if (ch == '-') p = -1;
    ch = getchar();
  }
  while (ch >= 48 && ch <= 57) {
    ans = (ans << 3) + (ans << 1) + ch - 48;
    ch = getchar();
  }
  return ans * p;
}
