#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> m;
  vector<int> b(m);
  for (int i = 0; i < m; i++) {
    cin >> b[i];
  }
  cin >> n;
  vector<int> p(n);
  for (int i = 0; i < n; i++) {
    cin >> p[i];
  }
  sort(b.begin(), b.end());
  sort(p.begin(), p.end());
  reverse(p.begin(), p.end());
  if (n <= b[0]) {
    long long lcv = 0;
    for (int i = 0; i < n; i++) {
      lcv += p[i];
    }
    cout << lcv << endl;
    return 0;
  }
  long long total = 0;
  int lcv = 0;
  while (lcv < n) {
    int tmp = 0, k = 0;
    while (tmp < b[0] && lcv < n) {
      total += p[lcv];
      lcv++;
      tmp++;
    }
    while (k < 2) {
      lcv++;
      k++;
    }
  }
  cout << total << endl;
  return 0;
}
