#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  vector<int> q, c;
  cin >> n;
  q.resize(n);
  for (int i = 0; i < n; ++i) cin >> q[i];
  cin >> m;
  c.resize(m);
  for (int i = 0; i < m; ++i) cin >> c[i];
  sort(q.begin(), q.end());
  sort(c.begin(), c.end());
  int cart = q[0], ans = 0, taken = 0;
  for (int i = ((int)c.size()) - 1; i >= 0; i--) {
    ans += c[i];
    ++taken;
    if (cart == taken) {
      taken = 0;
      for (int j = 0; j < 2 and i >= 0; ++j, --i)
        ;
    }
  }
  cout << ans << endl;
  return 0;
}
