#include <bits/stdc++.h>
using namespace std;
int main() {
  long long d[100000][4];
  int time[3];
  int num[3];
  int n;
  int i, j, k;
  cin >> num[0] >> num[1] >> num[2];
  cin >> time[0] >> time[1] >> time[2];
  cin >> n;
  for (i = 0; i < n; i++) cin >> d[i][3];
  for (i = 0; i < n; i++) {
    if (i < num[0])
      d[i][0] = d[i][3] + time[0];
    else {
      d[i][0] = max(d[i][3], d[i - num[0]][0]) + time[0];
    }
  }
  for (i = 1; i < 3; i++)
    for (j = 0; j < n; j++) {
      if (j < num[i])
        d[j][i] = d[j][i - 1] + time[i];
      else
        d[j][i] = max(d[j][i - 1], d[j - num[i]][i]) + time[i];
    }
  cout << d[n - 1][2] - d[n - 1][3];
  return 0;
}
