#include <bits/stdc++.h>
using namespace std;
int m, n;
int v[100010];
int main() {
  scanf("%d", &m);
  int menor = 0x3f3f3f3f;
  for (int i = 0; i < m; i++) {
    int t;
    scanf("%d", &t);
    if (t < menor) menor = t;
  }
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d", v + i);
  sort(v, v + n);
  int tot = 0;
  int ini = 0, fim = n - 1;
  if (n == 1) {
    printf("%d\n", v[0]);
    return 0;
  }
  int N = fim - ini + 1;
  while (N > 0) {
    if (N >= menor + 2) {
      for (int k = fim; k > fim - menor; k--) tot += v[k];
      fim -= menor + 2;
      N = fim - ini + 1;
      continue;
    }
    if (N >= menor + 1) {
      for (int k = fim; k > fim - menor; k--) tot += v[k];
      fim -= menor + 1;
      N = fim - ini + 1;
      continue;
    }
    for (int k = ini; k <= fim; k++) tot += v[k];
    break;
  }
  printf("%d\n", tot);
  return 0;
}
