#include <bits/stdc++.h>
using namespace std;
const int maxn = 100005;
int n, A, B, C, L = 2e9, R = 0, h[maxn];
long long calc(int H) {
  long long sumA = 0, sumB = 0;
  for (int i = 0; i < n; i++)
    if (h[i] < H)
      sumA += H - h[i];
    else
      sumB += h[i] - H;
  if (sumA > sumB)
    return (sumA - sumB) * A + sumB * C;
  else
    return (sumB - sumA) * B + sumA * C;
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0);
  cin >> n >> A >> B >> C;
  for (int i = 0; i < n; ++i) {
    cin >> h[i];
    L = min(L, h[i]), R = max(R, h[i]);
  }
  if (C > A + B) C = A + B;
  int mid;
  while (L < R) {
    mid = (L + R) >> 1;
    if (calc(mid) <= calc(mid + 1))
      R = mid;
    else
      L = mid + 1;
  }
  cout << calc(L) << '\n';
}
