#include <bits/stdc++.h>
const int mod = 1e9 + 7;
const int N = 100010;
const int inf = 0x3f3f3f3f;
using namespace std;
int a[100005];
int main() {
  int n, i, dis, cot, ans;
  while (~scanf("%d", &n)) {
    ans = 0;
    cot = 10000000;
    while (n--) {
      scanf("%d", &dis);
      cot = cot < dis ? cot : dis;
    }
    scanf("%d", &n);
    for (i = 1; i <= n; i++) scanf("%d", &a[i]);
    sort(a + 1, a + n + 1);
    for (i = n; i >= 1; i--)
      if ((n - i + 1) % (cot + 2) && (n - i + 1) % (cot + 2) != (cot + 1))
        ans += a[i];
    printf("%d\n", ans);
  }
}
