#include <bits/stdc++.h>
using namespace std;
const int INF = 1000 * 1000 * 1000;
const int XD = 100100;
int a[XD];
int main() {
  int m;
  scanf("%d", &m);
  int q = INF;
  for (int i = 0; i < m; ++i) {
    int qq;
    scanf("%d", &qq);
    q = min(q, qq);
  }
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) {
    scanf("%d", &a[i]);
  }
  sort(a, a + n, greater<int>());
  int ind = 0, res = 0;
  for (int i = 0; i < n; ++i) {
    if (ind < q) {
      res += a[i];
    }
    ind = (ind + 1) % (q + 2);
  }
  printf("%d\n", res);
  return 0;
}
