#include <bits/stdc++.h>
using namespace std;
int kind[100005], price[100005];
int cmp(const void* v1, const void* v2) { return *(int*)v1 - *(int*)v2; }
int main(void) {
  int m;
  scanf("%d", &m);
  for (int i = 0; i < (m); ++i) scanf("%d", &kind[i]);
  qsort(kind, m, 4, cmp);
  int n;
  scanf("%d", &n);
  for (int i = 0; i < (n); ++i) scanf("%d", &price[i]);
  qsort(price, n, 4, cmp);
  int ret = 0;
  int trace = n - 1;
  while (trace >= 0) {
    for (int i = 0; i < (kind[0]); ++i) {
      ret += price[trace--];
      if (trace == -1) break;
    }
    trace -= 2;
  }
  printf("%d", ret);
  return 0;
}
