#include <bits/stdc++.h>
using namespace std;
int main() {
  int m;
  cin >> m;
  int *dis = new int[m];
  for (int i = 0; i < m; i++) {
    cin >> dis[i];
  }
  int n;
  cin >> n;
  int *goods = new int[n];
  for (int i = 0; i < n; i++) {
    cin >> goods[i];
  }
  sort(goods, goods + n);
  sort(dis, dis + m);
  reverse(goods, goods + n);
  int summ = 0, pos = 0;
  while (pos < n) {
    int j = 0;
    while (pos < n && j < dis[0]) {
      summ += goods[pos];
      j++;
      pos++;
    }
    j = 0;
    while (pos < n && j < 2) pos++, j++;
  }
  cout << summ << endl;
}
