#include <bits/stdc++.h>
using namespace std;
long long int n, a, r, m;
long long int ar[100005];
long long int func(long long int len) {
  long long int cost = 0;
  long long int less = 0, more = 0;
  long long int i;
  for (i = 0; i < n; i++) {
    if (ar[i] < len) less = less + (len - ar[i]);
    if (ar[i] > len) more = more + (ar[i] - len);
  }
  if (m < a + r) {
    if (less < more) {
      more = more - less;
      cost = more * r;
      cost += less * m;
    } else {
      less = less - more;
      cost = more * m;
      cost += less * a;
    }
  } else {
    cost = less * a + more * r;
  }
  return cost;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> a >> r >> m;
  long long int i;
  for (i = 0; i < n; i++) cin >> ar[i];
  long long int ans = 1e10;
  long long int low = 0, high = 1e10;
  while (low <= high) {
    long long int mid1 = low + (high - low) / 3;
    long long int mid2 = mid1 + (high - low) / 3;
    if (func(mid1) < func(mid1 + 1) && func(mid1) < func(mid1 - 1)) {
      ans = mid1;
      break;
    }
    if (func(mid2) < func(mid2 + 1) && func(mid2) < func(mid2 - 1)) {
      ans = mid2;
      break;
    }
    if (func(mid1 - 1) < func(mid1)) {
      high = mid1 - 1;
    } else if (func(mid2 + 1) < func(mid2)) {
      low = mid2 + 1;
    } else {
      low = mid1 + 1;
      high = mid2 - 1;
    }
  }
  cout << func(ans);
}
