#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
int m, q[100005], n, a[100005];
void solve() {
  sort(q, q + m);
  sort(a, a + n);
  int sum = 0;
  for (int i = n - 1, j = 0; i >= 0; j++) {
    if (i + 1 >= q[0]) {
      for (int k = 0; k < q[0] && i >= 0; k++, i--) {
        sum += a[i];
      }
      for (int k = 0; k < 2 && i >= 0; k++, i--) {
      }
    } else {
      sum += a[i];
      i--;
    }
  }
  cout << sum << endl;
}
int main() {
  while (cin >> m) {
    for (int i = 0; i < m; i++) {
      scanf("%d", q + i);
    }
    scanf("%d", &n);
    for (int i = 0; i < n; i++) {
      scanf("%d", a + i);
    }
    solve();
  }
}
