#include <bits/stdc++.h>
using namespace std;
vector<int> Q;
vector<int> A;
int m, n;
int main() {
  cin >> m;
  int d = 0;
  for (int i = 0; i < m; ++i) {
    cin >> d;
    Q.push_back(d);
  }
  cin >> n;
  long long SUM = 0;
  for (int i = 0; i < n; ++i) {
    cin >> d;
    A.push_back(-d);
    SUM += d;
  }
  sort(Q.begin(), Q.end());
  int S = Q[0];
  if (S >= n) {
    cout << SUM << endl;
    return 0;
  }
  sort(A.begin(), A.end());
  long long ANS = 0;
  for (int i = 0; i < (int)A.size(); ++i) {
    for (int j = 0; (i + j) < (int)A.size() && j < S; ++j) {
      ANS += -A[i + j];
    }
    i += S + 2;
    i -= 1;
  }
  cout << ANS << endl;
  return 0;
}
