#include <bits/stdc++.h>
using namespace std;
int q[100005], a[100005];
int main() {
  int m, n;
  scanf("%d", &m);
  for (int i = 0; i < m; i++) {
    scanf("%d", &q[i]);
  }
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
  }
  sort(q, q + m);
  sort(a, a + n);
  int sum = 0;
  int num = 0;
  for (int i = n - 1; i >= 0;) {
    if (num == q[0]) {
      i -= 2;
      num = 0;
    } else {
      sum += a[i];
      i--;
      num++;
    }
  }
  printf("%d\n", sum);
  return 0;
}
