#include <bits/stdc++.h>
using namespace std;
bool sort_by(int a, int b) { return a > b; }
int main() {
  int m, n;
  cin >> m;
  int qm[m], q = INT_MAX;
  for (int i = 0; i < m; i++) {
    cin >> qm[i];
    q = min(q, qm[i]);
  }
  cin >> n;
  int a[n];
  for (int i = 0; i < n; i++) cin >> a[i];
  sort(a, a + n);
  int index = n - 1, price = 0;
  while (index >= 0) {
    for (int i = index; i >= max(0, index + 1 - q); i--) price += a[i];
    index -= q + 2;
  }
  cout << price;
  return 0;
}
