#include <bits/stdc++.h>
using namespace std;
const long long INF = (1LL << 62);
long long N, A, R, M;
long long num[101000];
long long pre_sum[101000];
long long cal_cost(long long base) {
  int l = 1, r = N;
  while (l <= r) {
    int mid = (l + r) >> 1;
    if (num[mid] >= base) {
      r = mid - 1;
    } else {
      l = mid + 1;
    }
  }
  long long left = pre_sum[r] - pre_sum[0];
  long long right = pre_sum[N] - pre_sum[r];
  long long cost1 = (r * base - left);
  long long cost2 = (right - (N - r) * base);
  long long cost = cost1 * A + cost2 * R;
  if (M < A + R) {
    cost -= min(cost1, cost2) * (A + R - M);
  }
  return cost;
}
int main() {
  cin >> N >> A >> R >> M;
  long long max_num = -INF;
  for (int i = 1; i <= N; i++) {
    cin >> num[i];
    max_num = max(max_num, num[i]);
  }
  sort(num + 1, num + N + 1);
  pre_sum[0] = 0;
  for (int i = 1; i <= N; i++) pre_sum[i] = pre_sum[i - 1] + num[i];
  long long ans = -1;
  long long l = 0, r = max_num + 1;
  long long cost1, cost2;
  while (l < r) {
    int mid1 = (l + r) >> 1;
    int mid2 = (mid1 + r) >> 1;
    cost1 = cal_cost(mid1);
    cost2 = cal_cost(mid2);
    if (ans == -1) ans = cost1;
    ans = min(ans, cost1);
    ans = min(ans, cost2);
    if (cost1 <= cost2) {
      r = mid2;
    } else {
      l = mid1;
    }
  }
  cout << ans << endl;
  return 0;
}
