#include <bits/stdc++.h>
using namespace std;
int main() {
  int a[100000];
  int n, i, j, sum = 0, m, index1, index2 = 0, min = 100000000;
  cin >> m;
  for (i = 0; i < m; i++) {
    scanf("%i", &index1);
    if (index1 < min) min = index1;
  }
  cin >> n;
  index1 = n - 1;
  j = n - 1;
  for (i = 0; i < n; i++) scanf("%i", &a[i]);
  sort(a, a + n);
  while (index1 > -1) {
    if (index1 + 1 > min)
      j = min;
    else
      j = index1 + 1;
    while (j > 0) {
      sum += a[index1];
      index1--;
      j--;
    }
    index1 -= 2;
  }
  cout << sum;
  return 0;
}
