#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
const double err = 1e-12;
const double PI = 3.141592653589793;
const int N = 1e5 + 5;
int m, mnq, n, cst;
vector<int> P(N);
void solve() {
  cin >> m;
  cst = 0;
  mnq = N;
  for (int i = 0; i < m; i++) {
    int tmp;
    cin >> tmp;
    mnq = min(mnq, tmp);
  }
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> P[i];
  }
  P.resize(n);
  sort(P.begin(), P.end());
  int cnt = 0;
  for (int i = n - 1; i >= 0; i--) {
    cnt++;
    if (cnt > mnq) {
      cnt = 0;
      i--;
      continue;
    }
    cst += P[i];
  }
  cout << cst << endl;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int t = 1;
  while (t--) solve();
  return 0;
}
