#include <bits/stdc++.h>
using namespace std;
long long n, X, Y, Z, a[100005];
long long calc(long long x) {
  long long l = 0, ls = 0, r = 0, rs = 0;
  for (long long i = 1; i <= n; i++)
    if (a[i] > x)
      r++, rs += a[i];
    else
      l++, ls += a[i];
  l = x * l - ls;
  r = rs - x * r;
  long long res = min(l, r);
  return min(l * X + r * Y, res * Z + (l - res) * X + (r - res) * Y);
}
bool check(long long x) { return calc(x) < calc(x + 1); }
void solve() {
  scanf("%lld%lld%lld%lld", &n, &X, &Y, &Z);
  for (long long i = 1; i <= n; i++) scanf("%lld", &a[i]);
  long long l = 1, r = 1e9, ans = 0;
  while (l <= r) {
    long long mid = (l + r) >> 1;
    if (check(mid))
      ans = mid, r = mid - 1;
    else
      l = mid + 1;
  }
  printf("%lld\n", min(calc(ans), min(calc(ans - 1), calc(ans + 1))));
}
signed main() { solve(); }
