#include <bits/stdc++.h>
using namespace std;
long long int check(long long int m, long long int arr[], long long int a,
                    long long int b, long long int c, int t) {
  long long int decr = 0, incr = 0, ans;
  for (int i = 0; i < t; i++) {
    if (arr[i] > m)
      decr += (arr[i] - m);
    else if (arr[i] < m)
      incr += (m - arr[i]);
  }
  if (a + b > c && decr > 0 && incr > 0)
    ans = (incr - min((long long int)decr, (long long int)incr)) * a +
          (decr - min((long long int)decr, (long long int)incr)) * b +
          (min((long long int)decr, (long long int)incr)) * c;
  else
    ans = (a * incr) + (b * decr);
  return ans;
}
void ts(long long int l, long long int r, long long int arr[], long long int a,
        long long int b, long long int c, int t) {
  long long int mini = 1e18, m1, m2, res1, res2;
  while (l <= r) {
    m1 = l + (r - l) / 3;
    m2 = r - (r - l) / 3;
    res1 = check(m1, arr, a, b, c, t);
    res2 = check(m2, arr, a, b, c, t);
    if (res1 > res2)
      l = m1 + 1;
    else
      r = m2 - 1;
    mini = min((long long int)mini,
               (long long int)min((long long int)res1, (long long int)res2));
  }
  cout << mini << endl;
}
int main() {
  int t;
  long long int a, b, c, arr[100005], maxi = 0, mini = 1e9 + 7;
  cin >> t >> a >> b >> c;
  for (int i = 0; i < t; i++) {
    cin >> arr[i];
    if (arr[i] > maxi) maxi = arr[i];
    if (arr[i] < mini) mini = arr[i];
  }
  ts(mini, maxi, arr, a, b, c, t);
  return 0;
}
