#include <bits/stdc++.h>
using namespace std;
long long n, a, r, m, arr[100005], ps[100005], sum, ans = 1e18;
vector<long long> v;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> a >> r >> m;
  m = min(m, a + r);
  for (long long i = (long long)1; i <= (long long)n; i++) {
    cin >> arr[i];
    v.push_back(arr[i]);
  }
  sort(arr + 1, arr + n + 1);
  for (long long i = (long long)1; i <= (long long)n; i++)
    ps[i] = ps[i - 1] + arr[i];
  v.push_back(ps[n] / n), v.push_back(ps[n] / n + 1);
  for (auto h : v) {
    long long x = upper_bound(arr + 1, arr + n + 1, h) - arr - 1;
    long long low = x * h - ps[x], upp = ps[n] - ps[x] - (n - x) * h;
    ans = min(ans, min(low, upp) * m + abs(low - upp) * (low > upp ? a : r));
  }
  cout << ans;
}
