#include <bits/stdc++.h>
using namespace std;
inline void getarrint(vector<int>& a, int n, istream& in) {
  for (int i = 0; i <= n - 1; i++) in >> a[i];
}
class Solution {
 public:
  void solve(std::istream& in, std::ostream& out) {
    int m, n;
    in >> m;
    vector<int> q(m);
    getarrint(q, m, in);
    in >> n;
    vector<int> a(n);
    getarrint(a, n, in);
    sort((q).begin(), (q).end());
    sort((a).begin(), (a).end());
    int mnq = q[0];
    reverse((a).begin(), (a).end());
    int cnt = 0;
    int money = 0;
    while (cnt < n) {
      if (cnt + mnq - 1 < n) {
        for (int i = cnt; i <= cnt + mnq - 1; i++) money += a[i];
        cnt = cnt + mnq;
        if (n > cnt) cnt++;
        if (n > cnt) cnt++;
      } else {
        money += a[cnt];
        cnt++;
      }
    }
    out << money << '\n';
    return;
  }
};
void solve(std::istream& in, std::ostream& out) {
  out << std::setprecision(12);
  Solution solution;
  solution.solve(in, out);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  istream& in = cin;
  ostream& out = cout;
  solve(in, out);
  return 0;
}
