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