#include <bits/stdc++.h>
using namespace std;
const int INF = 0x2aaaaaaa;
const long long INFLL = 0x1f1f1f1f1f1f1f1fLL;
template <class A, class B>
inline ostream& operator<<(ostream& st, const pair<A, B>& P) {
  return st << "(" << P.first << "," << P.second << ")";
};
template <class A, class B>
inline pair<A, B> operator+(const pair<A, B>& P, const pair<A, B>& Q) {
  return pair<A, B>(P.first + Q.first, P.second + Q.second);
};
template <class A, class B>
inline pair<A, B> operator-(const pair<A, B>& P, const pair<A, B>& Q) {
  return pair<A, B>(P.first - Q.first, P.second - Q.second);
};
int a[] = {1,   2,   4,   6,   8,   12,  16,  22,  24,  28,  32,  44,
           48,  56,  64,  86,  88,  92,  96,  112, 120, 128, 172, 176,
           184, 192, 220, 224, 240, 256, 342, 344, 348, 352, 368, 376,
           384, 440, 448, 480, 496, 512, 684, 688, 696, 704, 732, 736,
           752, 768, 880, 888, 896, 960, 992, 1024};
int main() {
  int n, A, B, C, T;
  cin >> n >> A >> B >> C >> T;
  long long retA = n * A;
  long long retB = 0;
  for (int i = 0; i < n; i++) {
    int t;
    cin >> t;
    retB += A + (T - t) * (C - B);
  }
  cout << max(retA, retB) << endl;
}
