#include <bits/stdc++.h>
using namespace std;
int q[1000000];
int a[1000000];
int main() {
  int m, n, sum = 0;
  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);
  for (int i = n - q[0]; i >= 0; i -= (q[0] + 2)) {
    if (i - 1 >= 0) a[i - 1] = 0;
    if (i - 2 >= 0) a[i - 2] = 0;
  }
  for (int i = 0; i < n; i++) sum += a[i];
  printf("%d\n", sum);
  return 0;
}
