#include <bits/stdc++.h>
using namespace std;
const int maxn = 100010;
int num[maxn], cost[maxn];
bool cmp(int a, int b);
int main() {
  int n, m, i, j, sum = 0, temp = 0x7fffffff;
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%d", &num[i]);
    if (num[i] < temp) temp = num[i];
  }
  scanf("%d", &m);
  for (i = 0; i < m; i++) scanf("%d", &cost[i]);
  sort(cost, cost + m, cmp);
  i = 0;
  while (i < m) {
    for (j = 0; j < temp && i < m; j++) sum = sum + cost[i++];
    i = i + 2;
  }
  printf("%d\n", sum);
  return 0;
}
bool cmp(int a, int b) { return a > b; }
