#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5;
const long long INF = 1e18 + 1;
const int MOD = 1e9 + 7;
int n, a, b, c, tM;
int t[maxn];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  ;
  cin >> n >> a >> b >> c >> tM;
  for (int i = 0; i < (n); i++) cin >> t[i];
  sort(t, t + n);
  long long ans = 0;
  for (int i = 0; i < (n); i++) {
    int mx = a;
    for (int j = t[i]; j <= tM; j++) {
      mx = max(mx, c * (j - t[i]) + (a - (j - t[i]) * b));
    }
    ans += mx;
  }
  cout << ans;
  cerr << endl
       << endl
       << "Time execute: " << (float)clock() / CLOCKS_PER_SEC << endl;
  return 0;
}
