#include <bits/stdc++.h>
using namespace std;
bool cmp(int m, int n) { return m > n; }
int main() {
  int m, n, a[100001], b[100001];
  int i, j, min = 100001, sum = 0;
  cin >> m;
  for (i = 0; i < m; i++) {
    cin >> a[i];
    min = min > a[i] ? a[i] : min;
  }
  cin >> n;
  for (j = 0; j < n; j++) {
    cin >> b[j];
  }
  sort(b, b + n, cmp);
  i = 0;
  while (i < n) {
    j = 0;
    while (j < min && i < n) {
      sum += b[i++];
      j++;
    }
    i += 2;
  }
  cout << sum << endl;
  return 0;
}
