#include <bits/stdc++.h>
using namespace std;
int n, A, B, R;
long long h[100005], maxx;
long long check(long long mid) {
  long long now = 0, l = 0, r = 0;
  for (int i = 1; i <= n; i++) {
    if (h[i] < mid)
      l += mid - h[i];
    else
      r += h[i] - mid;
  }
  now += 1ll * min(l, r) * R;
  long long cs = min(l, r);
  l -= cs;
  r -= cs;
  if (l) now += 1ll * l * A;
  if (r) now += 1ll * r * B;
  return now;
}
int main() {
  scanf("%d %d %d %d", &n, &A, &B, &R);
  R = min(R, A + B);
  for (int i = 1; i <= n; i++) scanf("%lld", &h[i]), maxx = max(maxx, h[i]);
  long long ans = 1e18, l = 0, r = maxx;
  while (l + 1 < r) {
    long long lmid = l + (r - l + 1) / 3, rmid = r - (r - l + 1) / 3;
    if (check(lmid) >= check(rmid))
      l = lmid;
    else
      r = rmid;
  }
  printf("%lld\n", min(check(l), check(r)));
  return 0;
}
