#include <bits/stdc++.h>
using namespace std;
unsigned int v[100000];
int main() {
  unsigned int m, n, q = -1;
  cin >> m;
  for (unsigned int i = 0; i < m; ++i) {
    unsigned int c;
    cin >> c;
    if (c < q) q = c;
  }
  cin >> n;
  for (unsigned int i = 0; i < n; ++i) cin >> v[i];
  sort(v, v + n, greater<unsigned int>());
  unsigned long long s = 0, r = 0;
  while (r + q <= n) {
    for (unsigned int i = 0; i < q; ++i, ++r) s += v[r];
    if (r < n) ++r;
    if (r < n) ++r;
  }
  for (unsigned int i = r; i < n; ++i) s += v[i];
  cout << s << endl;
  return 0;
}
