#include <bits/stdc++.h>
using namespace std;
template <class T>
string itos(T n) {
  ostringstream s;
  s << n;
  return s.str();
}
template <class T>
void stoi(string s, T &n) {
  n = 0;
  for (int i = (int)0; i < (int)s.length(); ++i) n = n * 10 + s[i] - '0';
}
int main() {
  int m, n;
  cin >> m;
  int dis[m];
  for (int i = (int)0; i < (int)m; ++i) cin >> dis[i];
  cin >> n;
  int val[n];
  for (int i = (int)0; i < (int)n; ++i) cin >> val[i];
  sort(dis, dis + m);
  sort(val, val + n);
  int cst = 0;
  for (int i = n - 1; i >= 0; --i) {
    int cnt = 0;
    while (i >= 0 && cnt < dis[0]) cst += val[i], i--, cnt++;
    i--;
  }
  cout << cst << endl;
  return 0;
}
