#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int MOD = 1e9 + 7;
const ll INF = 1e18 + 9;
ll powmod(ll base, ll exp, const ll MOD) {
  ll ans = 1;
  while (exp) {
    if (exp & 1) ans = (ans * base) % MOD;
    base = (base * base) % MOD;
    exp >>= 1;
  }
  return ans;
}
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
ll lcm(ll a, ll b) { return (a * b) / gcd(a, b); }
ll modInverse(ll n, const ll p) { return powmod(n, p - 2, p); }
void add(ll& x, ll v) {
  x = (x + v) % MOD;
  if (x < 0) x += MOD;
}
void test_case() {}
ll N, A, R, M;
vector<ll> h, pre;
ll f(ll x) {
  int pos = lower_bound(h.begin(), h.end(), x) - h.begin();
  ll k1 = x * pos - pre[pos];
  ll k2 = pre[N] - pre[pos] - x * (N - pos);
  ll res = min(k1, k2);
  k1 -= res;
  k2 -= res;
  res *= M;
  res += k1 * A;
  res += k2 * R;
  return res;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  cin >> N >> A >> R >> M;
  h.resize(N);
  pre.resize(N + 1);
  M = min(A + R, M);
  for (int i = 0; i < N; ++i) cin >> h[i];
  sort(h.begin(), h.end());
  for (int i = 0; i < N; ++i) pre[i + 1] = pre[i] + h[i];
  ll lo = h[0];
  ll hi = h[N - 1];
  ll ans = 2e18 + 99;
  for (int iter = 1; iter <= 100; ++iter) {
    ll x1 = lo + (hi - lo) / 3;
    ll x2 = hi - (hi - lo) / 3;
    if (f(x1) > f(x2))
      lo = x1;
    else
      hi = x2;
  }
  for (ll i = lo; i <= hi; ++i) ans = min(ans, f(i));
  cout << ans;
  return 0;
}
