#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100001;
int q, n;
int d[MAXN], p[MAXN];
int main() {
  cin >> q;
  int small = 1 << 30;
  for (int i = 0; i < q; ++i) {
    cin >> d[i];
    small = ((small) > (d[i]) ? (d[i]) : (small));
  }
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> p[i];
  }
  sort(p, p + n, greater<int>());
  int cost = 0;
  for (int i = 0; i < n; i++) {
    if (i % (small + 2) < small) {
      cost += p[i];
    }
  }
  cout << cost << endl;
  return 0;
}
