#include <bits/stdc++.h>
int const N = 100000;
int h[N + 1];
int n;
int a, r, m;
long long pre[N + 1];
long long calc(int);
long long calc(int v) {
  int pos = std::upper_bound(h + 1, h + 1 + n, v) - 1 - h;
  long long lower = 1ll * v * pos - pre[pos];
  long long upper = pre[n] - pre[pos] - 1ll * (n - pos) * v;
  if (lower <= upper) {
    return lower * m + (upper - lower) * r;
  } else {
    return upper * m + (lower - upper) * a;
  }
}
int main() {
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);
  std::cout.tie(0);
  std::cin >> n >> a >> r >> m;
  m = std::min(a + r, m);
  for (int i = 1; i <= n; i++) {
    std::cin >> h[i];
  }
  std::sort(h + 1, h + 1 + n);
  for (int i = 1; i <= n; i++) {
    pre[i] = pre[i - 1] + h[i];
  }
  int l = h[1];
  int r = h[n];
  int ans = 0;
  while (l <= r) {
    int mid = (l + r) / 2;
    int rmid = (mid + r + 1) / 2;
    if (calc(mid) < calc(rmid)) {
      ans = mid;
      r = rmid - 1;
    } else {
      ans = rmid;
      l = mid + 1;
    }
  }
  std::cout << calc(ans);
  return 0;
}
