#include <bits/stdc++.h>
using namespace std;
int main() {
  int m;
  vector<int> disc;
  cin >> m;
  for (int i = 0; i < m; ++i) {
    int num;
    cin >> num;
    disc.push_back(num);
  }
  int n;
  vector<int> price;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    int num;
    cin >> num;
    price.push_back(num);
  }
  std::sort(price.begin(), price.end());
  std::reverse(price.begin(), price.end());
  int min_disc = 0x7FFFFFFF;
  for (int i = 0; i < disc.size(); ++i) {
    if (disc[i] < min_disc) min_disc = disc[i];
  }
  int total = 0;
  int i = 0;
  while (i < price.size()) {
    int count = 0;
    int d;
    for (d = i; d < price.size() && count < min_disc; ++d) {
      if (price[d] != -1) {
        total += price[d];
        price[d] = -1;
        ++count;
      }
    }
    int count_free = 0;
    for (; d < price.size() && count_free < 2; ++d) {
      if (price[d] != -1) {
        price[d] = -1;
        ++count_free;
      }
    }
    i = d;
    while (price[i] == -1) ++i;
  }
  cout << total << endl;
}
