#include <bits/stdc++.h>
using namespace std;
int i, N, M, A[100005], q[100005];
bool cmp(int X, int Y) { return X < Y; }
bool cmp1(int X, int Y) { return X > Y; }
int main() {
  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, cmp);
  sort(A, A + N, cmp1);
  int t = q[0], ans = 0;
  for (i = 0; i < N; ++i) {
    ans += A[i];
    --t;
    if (t == 0) {
      i += 2;
      t = q[0];
    }
  }
  printf("%d\n", ans);
  return 0;
}
