#include <bits/stdc++.h>
using namespace std;
const long long int mod = 1e9 + 7;
const long long int mod2 = 1e9 + 9;
const long long int maxn = 1e6 + 1;
const long long int maxn1 = 1e7 + 1;
const int root = 1e6 + 5;
const long long inf = 1e18 + 18;
double pie4 = 3.1415926535;
long long int T[1001];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int i, n, j, a, b, c, t, val, ans, res = 0;
  cin >> n >> a >> b >> c >> t;
  for (i = 1; i <= n; i++) cin >> T[i];
  for (i = 1; i <= n; i++) {
    val = 0;
    for (j = T[i]; j <= t; j++) {
      ans = c * (j - T[i]) + a - b * (j - T[i]);
      val = max(val, ans);
    }
    res += val;
  }
  cout << res;
}
