#include <bits/stdc++.h>
using namespace std;
const int MAX = 1e5 + 9;
int n, h[MAX], A, R, M;
long long get(int x) {
  long long need = 0, more = 0;
  for (int i = 1; i <= n; ++i) {
    if (h[i] > x)
      more += h[i] - x;
    else
      need += x - h[i];
  }
  long long cost1 = 1LL * need * A + 1LL * more * R;
  long long mn = min(need, more);
  need -= mn;
  more -= mn;
  long long cost2 = 1LL * mn * M + 1LL * need * A + 1LL * more * R;
  return min(cost1, cost2);
}
long long ternarySearch(int low, int high) {
  while (low < high) {
    int mid1 = low + (high - low) / 3, mid2 = high - (high - low) / 3;
    if (get(mid1) < get(mid2)) {
      high = mid2 - 1;
    } else {
      low = mid1 + 1;
    }
  }
  long long ans = get(low);
  for (int i = max(0, low - 3); i <= high + 3; ++i) {
    ans = min(ans, get(i));
  }
  return ans;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n >> A >> R >> M;
  int mn = 1e9 + 9, mx = 0;
  for (int i = 1; i <= n; ++i) {
    cin >> h[i];
    mn = min(mn, h[i]);
    mx = max(mx, h[i]);
  }
  cout << ternarySearch(mn, mx);
  return 0;
}
