#include <bits/stdc++.h>
using namespace std;
int arr[100001];
int N, A, R, M;
long long search(long long h) {
  long long sumOfRemove = 0;
  long long sumOfPut = 0;
  long long sumOfMove = 0;
  for (long long i = 0; i < N; i++) {
    if (arr[i] > h) {
      sumOfRemove += (arr[i] - h);
    } else {
      sumOfPut += (h - arr[i]);
    }
  }
  long long mi = min(sumOfRemove, sumOfPut);
  if (M < (A + R)) {
    sumOfMove = mi * M;
    return (sumOfMove + (sumOfRemove - mi) * R + (sumOfPut - mi) * A);
  } else {
    return (sumOfRemove * R + sumOfPut * A);
  }
}
int main() {
  cin >> N >> A >> R >> M;
  for (int i = 0; i < N; i++) {
    cin >> arr[i];
  }
  sort(arr, arr + N);
  long long l = arr[0];
  long long r = arr[N - 1];
  long long res = 0;
  while (l < r) {
    int mid = (r + l) / 2;
    int mid2 = mid + 1;
    long long cost1 = search(mid);
    long long cost2 = search(mid2);
    if (cost1 > cost2) {
      l = mid2;
    } else {
      r = mid;
    }
    res = min(cost1, cost2);
  }
  cout << res << endl;
}
