#include <bits/stdc++.h>
int main() {
  using namespace std;
  int n, m, minq = 1000000, result = 0;
  vector<int> prices;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    int num;
    cin >> num;
    minq = min(num, minq);
  }
  cin >> m;
  for (int i = 0; i < m; ++i) {
    int num;
    cin >> num;
    prices.push_back(num);
  }
  sort(prices.begin(), prices.end());
  int size = prices.size();
  while (size > minq) {
    result +=
        accumulate(prices.begin() + size - minq, prices.begin() + size, 0);
    size -= (minq + 2);
  }
  size = max(size, 0);
  result += accumulate(prices.begin(), prices.begin() + size, 0);
  cout << result << endl;
}
