#include <bits/stdc++.h>
using namespace std;
const long long MAX = 1e6 + 10;
long long a[MAX];
long long n, m, A, B, C, T;
map<long long, long long> TM;
int main() {
  cin >> n >> A >> B >> C >> T;
  for (long long i = 1; i <= n; i++) cin >> a[i];
  sort(a + 1, a + 1 + n);
  long long sum = 0;
  for (long long i = 1; i <= n; i++) {
    long long x = A;
    long long y = 0;
    long long max1 = 0;
    for (long long j = a[i]; j <= T; j++) {
      max1 = max(x + y, max1);
      x -= B;
      y += C;
    }
    sum += max1;
  }
  cout << sum << endl;
  return 0;
}
