#include <bits/stdc++.h>
using namespace std;
int main() {
  int m, n;
  scanf("%d", &m);
  int q[m];
  for (int i = 0; i < m; i++) {
    scanf("%d", &q[i]);
  }
  scanf("%d", &n);
  int pr[n];
  for (int i = 0; i < n; i++) {
    scanf("%d", &pr[i]);
  }
  sort(pr, pr + n);
  sort(q, q + m);
  int total = 0, p;
  p = q[0];
  for (int i = n - 1; i >= 0;) {
    for (int j = 0; j < p; j++) {
      total += pr[i];
      i--;
      if (i < 0) break;
    }
    i -= 2;
  }
  printf("%d\n", total);
}
