#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int m;
  scanf("%d", &m);
  vector<int> q(m);
  for (int i = 0; i < (m); ++i) {
    scanf("%d", &q[i]);
  }
  sort((q).begin(), (q).end());
  int n;
  scanf("%d", &n);
  vector<int> a(n);
  for (int i = 0; i < (n); ++i) {
    scanf("%d", &a[i]);
  }
  sort((a).begin(), (a).end());
  int res = 0;
  while (!a.empty()) {
    for (int k = 0; k < q[0] && !a.empty(); ++k) {
      res += a.back();
      a.pop_back();
    }
    for (int k = 0; k < 2 && !a.empty(); ++k) {
      a.pop_back();
    }
  }
  printf("%d\n", res);
  return 0;
}
