#include <bits/stdc++.h>
using namespace std;
const int maxn = 100005;
int q[maxn];
int a[maxn];
bool cmp(int a, int b) { return a > b; }
int main() {
  int n, m;
  while (cin >> n) {
    for (int i = 0; i < n; i++) scanf("%d", q + i);
    cin >> m;
    for (int i = 0; i < m; i++) scanf("%d", a + i);
    sort(q, q + n);
    sort(a, a + m, cmp);
    long long sum = 0;
    int j = 0;
    while (j < m) {
      for (int k = j; k < j + q[0] && k < m; k++) {
        sum += a[k];
      }
      j += q[0];
      j += 2;
    }
    cout << sum << endl;
  }
}
