#include <bits/stdc++.h>
using namespace std;
bool cmp(int a, int b) { return a > b; }
int main() {
  int n, m, q[100000], a[100000], flag, minq, count;
  while (scanf("%d", &m) != EOF) {
    count = 0;
    minq = 1000000;
    for (int i = 0; i < m; i++) {
      scanf("%d", &q[i]);
      if (q[i] < minq) minq = q[i];
    }
    scanf("%d", &n);
    for (int i = 0; i < n; i++) scanf("%d", &a[i]);
    sort(a, a + n, cmp);
    flag = 0;
    int k = 0;
    for (int i = 0; i < n; i++) {
      if (k > 0) {
        k--;
        continue;
      }
      count += a[i];
      flag++;
      if (flag == minq) {
        k = 2;
        flag = 0;
      }
    }
    printf("%d\n", count);
  }
  return 0;
}
