#include <bits/stdc++.h>
using namespace std;
int q[1000000];
int a[1000000];
int main() {
  int n, m;
  while (scanf("%d", &m) != -1) {
    for (int i = 0; i < m; ++i) scanf("%d", q + i);
    sort(q, q + m);
    scanf("%d", &n);
    for (int i = 0; i < n; ++i) scanf("%d", a + i);
    sort(a, a + n);
    reverse(a, a + n);
    int res = 0, i;
    for (i = 0; i + q[0] <= n;) {
      for (int j = 0; j < q[0]; ++j) res += a[i++];
      i += 2;
    }
    while (i < n) res += a[i++];
    printf("%d\n", res);
  }
  return 0;
}
