#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
const int maxn = 1e6 + 5;
int a[maxn];
long long f[maxn][2];
int main() {
  int n, r1, r2, r3, d;
  scanf("%d%d%d%d%d", &n, &r1, &r2, &r3, &d);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
  }
  f[0][0] = -d;
  f[0][1] = 1e9;
  for (int i = 1; i <= n; i++) {
    long long tmp1 = (long long)a[i] * r1 + r3;
    long long tmp2 = min((long long)(a[i] + 1) * r1, (long long)r2);
    if (i == n) {
      f[i][0] = min(f[i - 1][0] + d + tmp1,
                    min(f[i - 1][1] + 2ll * d + tmp1 + r1,
                        f[i - 1][1] + 3ll * d + tmp2 + 2 * r1));
      f[i][1] = f[i - 1][0] + d + tmp2;
      f[i][0] = min(f[i][0], f[i][1] + 2 * d + r1);
      continue;
    }
    f[i][0] =
        min(f[i - 1][0] + d + tmp1, min(f[i - 1][1] + 3ll * d + tmp1 + r1,
                                        f[i - 1][1] + 3ll * d + tmp2 + 2 * r1));
    f[i][1] = f[i - 1][0] + d + tmp2;
  }
  printf("%lld\n", f[n][0]);
  return 0;
}
