#include <bits/stdc++.h>
using namespace std;
int s[100005];
int bas[100005];
const int INF = 0x7fffffff;
bool cmp(int a, int b) { return a > b; }
int main() {
  int n, m;
  while (scanf("%d", &m) != EOF) {
    memset(s, 0, sizeof(s));
    memset(bas, 0, sizeof(bas));
    int i, j;
    int minbas = INF;
    for (i = 0; i < m; i++) {
      scanf("%d", &bas[i]);
      if (minbas > bas[i]) minbas = bas[i];
    }
    scanf("%d", &n);
    for (i = 0; i < n; i++) {
      scanf("%d", &s[i]);
    }
    sort(s, s + n, cmp);
    int sum = 0;
    int tot = 0;
    int pan = 0;
    for (i = 0; i < n;) {
      for (j = 0; j < minbas; j++) {
        sum += s[i];
        i++;
        if (i >= n) {
          pan = 1;
          break;
        }
      }
      i += 2;
    }
    printf("%d\n", sum);
  }
  return 0;
}
