#include <bits/stdc++.h>
using namespace std;
const int inf = 1e9;
const long long INF = 1e18, MOD = 1e9 + 7;
;
long long pow(long long a, long long b) {
  long long res = 1;
  while (b) {
    if (b & 1) res = (res * a) % MOD;
    a = (a * a) % MOD;
    b = b >> 1;
  }
  return res;
}
long long gcd(long long a, long long b) {
  if (a < b) return gcd(b, a);
  if (!b) return a;
  return gcd(b, a % b);
}
long long n, A, B, C, T, arr[1005];
long long ans;
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  ;
  cin >> n >> A >> B >> C >> T;
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
  }
  for (int i = 0; i < n; i++) {
    long long ma = -INF;
    for (int j = arr[i]; j <= T; j++) {
      ma = max(ma, C * (j - arr[i]) + A - B * (j - arr[i]));
    }
    ans += ma;
  }
  cout << ans;
  return 0;
}
