#include <bits/stdc++.h>
using namespace std;
const int INF = 1000000000;
const double eps = 1e-10;
const int MOD = 1000000007;
int num[100010];
int main() {
  int a, b, mina = INF, t;
  scanf("%d", &a);
  for (int i = 0; i < (a); ++i) {
    scanf("%d", &t);
    mina = min(mina, t);
  }
  scanf("%d", &b);
  for (int i = 0; i < (b); ++i) {
    scanf("%d", &num[i]);
  }
  sort(num, num + b);
  int cnt = b - 1;
  int ans = 0;
  while (cnt >= 0) {
    for (int i = 0; i < mina && cnt >= i; i++) {
      ans += num[cnt - i];
    }
    cnt -= mina + 2;
  }
  printf("%d\n", ans);
  return 0;
}
