#include <bits/stdc++.h>
using namespace std;
inline long long mod(long long n, long long m) {
  long long ret = n % m;
  if (ret < 0) ret += m;
  return ret;
}
long long gcd(long long a, long long b) {
  return (b == 0LL ? a : gcd(b, a % b));
}
long long exp(long long a, long long b, long long m) {
  if (b == 0LL) return 1LL;
  if (b == 1LL) return mod(a, m);
  long long k = mod(exp(a, b / 2, m), m);
  if (b & 1LL) {
    return mod(a * mod(k * k, m), m);
  } else
    return mod(k * k, m);
}
const int N = 1e6 + 100;
long long a[N];
long long r1, r2, r3;
long long d;
long long dp[N][2];
bool vis[N][2];
int n;
long long solve(int i, int f) {
  if (i == n + 1) {
    if (f) return d;
    return -d;
  }
  if (vis[i][f]) return dp[i][f];
  vis[i][f] = 1;
  long long op1 = a[i] * r1 + r3;
  if (f) op1 += d + d;
  op1 += solve(i + 1, 0) + d;
  long long op2 = r2 + r1;
  if (f) {
    op2 += d * 2;
    op2 += d + solve(i + 1, 0);
  } else {
    op2 += solve(i + 1, 1) + d;
  }
  long long op3 = (a[i] + 2) * r1;
  if (f) {
    op3 += d * 2;
    op3 += d + solve(i + 1, 0);
  } else {
    op3 += solve(i + 1, 1) + d;
  }
  if (i == n and f) {
    long long op4 = a[i] * r1 + r3 + d;
    op1 = min(op1, op4);
  }
  return dp[i][f] = min({op1, op2, op3});
}
void roll(int i, int f) {
  if (i == n + 1) return;
  long long op1 = a[i] * r1 + r3;
  if (f) op1 += d + d;
  op1 += solve(i + 1, 0) + d;
  long long op2 = r2 + r1;
  if (f) {
    op2 += d * 2;
    op2 += d + solve(i + 1, 0);
  } else {
    op2 += solve(i + 1, 1) + d;
  }
  long long op3 = (a[i] + 2) * r1;
  if (f) {
    op3 += d * 2;
    op3 += d + solve(i + 1, 0);
  } else {
    op3 += solve(i + 1, 1) + d;
  }
  if (i == n and f) {
    long long op4 = a[i] * r1 + r3 + d;
    op1 = min(op1, op4);
  }
  if (i == 1) {
    cout << "best " << min({op1, op2, op3}) << "\n";
  }
  if (op1 == min({op1, op2, op3})) {
    cout << "use op1 at " << i << " " << f << "\n";
    roll(i + 1, 0);
    return;
  }
  if (op2 == min({op2, op3})) {
    cout << "use op2 at " << i << " " << f << "\n";
    if (f)
      roll(i + 1, 0);
    else
      roll(i + 1, 1);
    return;
  }
  cout << "use op3 at " << i << " " << f << "\n";
  if (f)
    roll(i + 1, 0);
  else
    roll(i + 1, 1);
  return;
}
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  cin >> n >> r1 >> r2 >> r3 >> d;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  cout << solve(1, 0) << "\n";
  return 0;
  roll(1, 0);
}
