#include <bits/stdc++.h>
using namespace std;
int N, M, Q, A[100005];
int main() {
  scanf("%d", &M);
  Q = 999999999;
  for (int i = 0; i < (int)M; i++) {
    int x;
    scanf("%d", &x);
    Q = min(Q, x);
  }
  scanf("%d", &N);
  for (int i = 0; i < (int)N; i++) scanf("%d", &A[i]);
  sort(A, A + N);
  reverse(A, A + N);
  int res = 0;
  int i = 0;
  while (i < N) {
    for (int q = 0; q < (int)Q; q++) {
      res += A[i];
      i++;
      if (i == N) break;
    }
    for (int k = 0; k < (int)2; k++)
      if (i < N) i++;
  }
  printf("%d\n", res);
}
