#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  while (cin >> n) {
    long long int r1, r2, r3;
    long long int d;
    cin >> r1 >> r2 >> r3 >> d;
    long long int arr[n + 1];
    long long int atk1[n + 1];
    long long int atk2[n + 1];
    for (int i = 1; i <= n; i++) {
      cin >> arr[i];
    }
    for (int i = 1; i <= n; i++) {
      atk1[i] = min(r1, r3) * arr[i] + r3;
      long long int y = min(r1, r2);
      y = min(y, r3);
      atk2[i] = r2 + y;
      atk2[i] = min(min(r1, r3) * arr[i] + 2 * r1, atk2[i]);
    }
    long long int dis[n + 1];
    for (int i = 1; i <= n; i++) {
      long long int y;
      if (atk2[i] >= atk1[i]) {
        y = 0;
      } else {
        y = atk1[i] - atk2[i];
      }
      dis[i] = y;
    }
    long long int go;
    long long int res[n + 1];
    long long int ord = 0;
    for (int i = 1; i <= n - 1; i++) {
      ord += (atk1[i] - dis[i] + d);
    }
    res[0] = ord + (n - 1) * d + atk1[n];
    long long int maxi;
    if (res[0] > 0) {
      maxi = res[0];
    } else {
      maxi = 0;
    }
    res[1] = res[0] + dis[1] - d;
    if (res[1] > 0) {
      maxi = min(res[1], maxi);
    }
    for (int i = 2; i <= n - 1; i++) {
      res[i] = min(res[i - 2], res[i - 1] - d + dis[i]);
      res[i] = min(res[i], res[i - 1] + d);
      maxi = min(maxi, res[i]);
    }
    maxi = min(maxi, res[n - 2] - dis[n] + d);
    cout << maxi << "\n";
  }
}
