#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10;
int N, A, R, M;
int H[maxn];
long long wuhu(int h) {
  long long sub = 0, add = 0, res = 0;
  for (int i = 1; i <= N; i++)
    if (H[i] < h)
      add += h - H[i];
    else
      sub += h - H[i];
  if (M < A + R) {
    long long mi = min(abs(sub), add), dif = sub + add;
    res += mi * M;
    if (abs(sub) < add)
      res += abs(dif) * A;
    else
      res += abs(dif) * R;
  } else
    res = abs(sub) * R + add * A;
  return res;
}
int main() {
  scanf("%d%d%d%d", &N, &A, &R, &M);
  int l = 0, r = 0;
  for (int i = 1; i <= N; i++) scanf("%d", &H[i]), r = max(H[i], r);
  while (l < r) {
    int midl = l + (r - l) / 3;
    int midr = r - (r - l) / 3;
    if (wuhu(midl) >= wuhu(midr))
      l = midl + 1;
    else
      r = midr - 1;
  }
  printf("%lld\n", wuhu(l));
  return 0;
}
