#include <bits/stdc++.h>
using namespace std;
int main() {
  int m;
  cin >> m;
  int q;
  int min_q = INT_MAX;
  for (int i = 0; i < m; i++) {
    cin >> q;
    if (q < min_q) min_q = q;
  }
  int a[100001];
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort(a, a + n);
  int tot = 0;
  int i = n - 1;
  int aux = 0;
  while (i >= 0) {
    tot += a[i];
    aux++;
    if (aux == min_q) {
      aux = 0;
      i -= 2;
    }
    i--;
  }
  cout << tot << endl;
}
