#include <bits/stdc++.h>
const int MAX = 1e5 + 11;
using namespace std;
int N, M, A[MAX], B[MAX];
int main() {
  scanf("%d", &(N));
  for (int i = 0; i < (N); ++i) scanf("%d", &(A[i]));
  scanf("%d", &(M));
  for (int i = 0; i < (M); ++i) scanf("%d", &(B[i]));
  sort(B, B + M);
  reverse(B, B + M);
  int k = 0;
  for (int i = 0; i < (N); ++i) {
    if (A[k] > A[i]) {
      k = i;
    }
  }
  k = A[k];
  int res = 0;
  for (int i = 0; i < (M); ++i) {
    int j = i;
    while (j - i < k && j < M) {
      res += B[j];
      j++;
    }
    i = j + 1;
  }
  printf("%d", res);
  return 0;
}
