#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int n, a, b, c, t;
  cin >> n >> a >> b >> c >> t;
  long long int arr[n];
  long long int f[1001] = {0};
  for (long long int i = 0; i < n; i++) {
    cin >> arr[i];
    f[arr[i]]++;
  }
  long long int sum = 0;
  for (long long int i = 1; i <= t; i++) {
    if (f[i] > 0) {
      long long int curr = a;
      long long int currmax = a;
      for (int j = i + 1; j <= t; j++) {
        curr = curr - b;
        if (curr + (j - i) * c >= currmax) currmax = curr + (j - i) * c;
      }
      sum += (currmax * f[i]);
    }
  }
  cout << sum << endl;
  return 0;
}
