#include <bits/stdc++.h>
using namespace std;
int a[100001] = {0};
int b[100001] = {0};
int main() {
  int i, j, k, n, m, q, fl, z, l, x;
  scanf("%d", &m);
  for (i = 0; i < m; i++) scanf("%d", &b[i]);
  scanf("%d", &n);
  for (i = 0; i < n; i++) scanf("%d", &a[i]);
  sort(a, a + n);
  reverse(a, a + n);
  sort(b, b + m);
  l = 0;
  i = 0;
  j = 0;
  while (i < n) {
    l += a[i];
    j++;
    if (j >= b[0]) {
      i += 2;
      j = 0;
    }
    i++;
  }
  printf("%d\n", l);
  return 0;
}
