import std.stdio;
import std.range;
import std.array;
import std.string;
import std.conv;
import std.typecons;
import std.algorithm;
import std.container;
import std.typecons;
import std.random;
import std.csv;
import std.regex;
import std.math;
import core.time;
import std.ascii;
import std.digest.sha;
import std.outbuffer;

void main() {
	auto args = readln.chomp.split.map!(to!int).array;
	int n = args[0];
	int A = args[1];
	int B = args[2];
	int C = args[3];
	int T = args[4];
	int[] t = readln.chomp.split.map!(to!int).array;
	int[][][] dp = new int[][][](T + 2, T + 2, 2);
	int[int] dic;
	for (int i = 1; i <= T; ++i) {
		dic[i] = 0;
	}
	foreach (v; t) {
		++dic[v];
	}
	debug stderr.writeln(dic);
	for (int i = 1; i <= T; ++i) {
		for (int j = 1; j <= i; ++j) {
			debug stderr.writeln(tuple(i, j, 1));
			{
				dp[i + 1][j][1] = dp[i][j][1] + dic[j] * C;
				debug stderr.writefln("\tdp[%d][%d][1] = %d (%d + %d * %d)", i + 1, j, dp[i + 1][j][0], dp[i][j][1], dic[j], C);
			}
			{
				int pena = A - (i - j) * B;
				dp[i + 1][j][0] = max(dp[i][j][0], dp[i][j][1] + dic[j] * pena);
				debug stderr.writefln("\tdp[%d][%d][0] = %d (max(%d, %d + %d * %d)", i + 1, j, dp[i + 1][j][0], dp[i][j][0], dp[i][j][1], dic[j], pena);
			}
		}
	}
	int sum = 0;
	for (int i = 1; i <= T; ++i) {
		debug stderr.writefln("\t(%d) : %d", i, dp[T + 1][i][0]);
		sum += dp[T + 1][i][0];
	}
	sum.writeln;
}


