#include <bits/stdc++.h>
using namespace std;
int m, n, menor, atu, tot;
int q[100010], v[100010];
int main() {
  scanf("%d", &m);
  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", v + i);
  sort(v, v + n);
  menor = 0;
  for (int i = 0; i < n; i++) menor += v[i];
  atu = 0;
  tot = 0;
  for (int i = n - 1; i >= 0; i--) {
    if (atu == q[0]) {
      atu = 0;
      if (i - 1 >= 0) {
        i -= 1;
        continue;
      }
      continue;
    }
    atu++;
    tot += v[i];
  }
  printf("%d\n", min(menor, tot));
  return 0;
}
