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