#include <bits/stdc++.h>
using namespace std;
const long long OO = (long long)1e18;
const long long mod = (1e9) + 7;
const double PI = acos(-1.0);
const double EPS = 1e-8;
int dx[]{-1, -1, -1, 0, 0, 1, 1, 1};
int dy[]{-1, 0, 1, -1, 1, -1, 0, 1};
void file() {}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n, a, b, c, t;
  cin >> n >> a >> b >> c >> t;
  vector<long long> v(n);
  long long sum = 0;
  for (int i = 0; i < n; i++) {
    cin >> v[i];
    v[i] = t - v[i];
    sum += v[i];
  }
  long long mx1 = n * a;
  long long mx2 = sum * c;
  long long temp = 0;
  for (int i = 0; i < n; i++) {
    temp += (a - v[i] * b);
  }
  mx2 += temp;
  cout << max(mx1, mx2) << endl;
}
