#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  int m, n, t;
  cin >> m;
  int qi[m];
  for (int i = 0; i < m; i++) cin >> qi[i];
  sort(qi, qi + m);
  int q = qi[0], s = 0;
  cin >> n;
  priority_queue<int> pq;
  for (int i = 0; i < n; i++) {
    cin >> t;
    pq.push(t);
  }
  while (pq.size() >= q) {
    for (int i = 0; i < q; i++) {
      s += pq.top();
      pq.pop();
    }
    if (pq.size()) pq.pop();
    if (pq.size()) pq.pop();
  }
  while (pq.size()) {
    s += pq.top();
    pq.pop();
  }
  cout << s << endl;
  return 0;
}
