#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, i, i2, i3, re = 0;
  vector<int> disc, prices;
  cin >> m;
  disc.reserve(m);
  for (i = 0; i < m; i++) {
    cin >> i2;
    disc.push_back(i2);
  }
  cin >> n;
  prices.reserve(n);
  for (i = 0; i < n; i++) {
    cin >> i2;
    prices.push_back(i2);
  }
  sort(disc.begin(), disc.end());
  sort(prices.begin(), prices.end());
  i2 = n - 1;
  while (i2 >= 0) {
    for (i3 = 0; i3 < disc[0] && i2 >= 0; i3++) {
      re += prices[i2];
      i2--;
    }
    i2 -= 2;
  }
  cout << re;
  return 0;
}
